A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.cdn.mozilla.net/ja/docs/Web/API/CSSStyleDeclaration/length below:

CSSStyleDeclaration.length - Web API | MDN

CSSStyleDeclaration.length

Baseline Widely available

読み取り専用のプロパティで、この CSS 宣言ブロックにあるスタイル宣言の数を整数で表します。

値

このインスタンスの親に明示的に設定されているスタイルの数を示す整数です。

例

次の例は、以下の HTML 要素に明示的に設定されたスタイルの数を取得します。

<div
  id="div1"
  style="margin: 0 10px; background-color: #CA1; font-family: monospace"></div>

JavaScript コード:

const myDiv = document.getElementById("div1");
const divStyle = myDiv.style;
const len = divStyle.length; // 6
仕様書 ブラウザーの互換性

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4