From 3cf333fe1acf5afa23dac5c2beaa20398e08a25f Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Thu, 6 Jan 2022 01:46:13 +0900 Subject: 各セレクターの記事を変換準備 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- files/ja/web/css/id_selectors/index.html | 83 -------------------------------- files/ja/web/css/id_selectors/index.md | 83 ++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 83 deletions(-) delete mode 100644 files/ja/web/css/id_selectors/index.html create mode 100644 files/ja/web/css/id_selectors/index.md (limited to 'files/ja/web/css/id_selectors') diff --git a/files/ja/web/css/id_selectors/index.html b/files/ja/web/css/id_selectors/index.html deleted file mode 100644 index 6557f2663b..0000000000 --- a/files/ja/web/css/id_selectors/index.html +++ /dev/null @@ -1,83 +0,0 @@ ---- -title: ID セレクター -slug: Web/CSS/ID_selectors -tags: - - CSS - - Reference - - Selector - - Selectors -translation_of: Web/CSS/ID_selectors ---- -
{{CSSRef}}
- -

CSS の ID セレクター (ID selector) は、 {{htmlattrxref("id")}} 属性の値に基づいて要素と一致します。選択される要素の id 属性は、セレクターで指定した値と完全一致していなければなりません。

- -
/* id="demo" のついた要素 */
-#demo {
-  border: red 2px solid;
-}
- -

構文

- -
#id_value { スタイルプロパティ }
- -

なお、これは次の{{Cssxref("Attribute_selectors", "属性セレクター")}}と等価です (ただし、詳細度は異なります)。

- -
[id=id_value] { スタイルプロパティ }
- -

- -

CSS

- -
#identified {
-  background-color: skyblue;
-}
-
- -

HTML

- -
<div id="identified">これは特別な ID がついています!</div>
-<div>これは単なる普通の div です。</div>
-
- -

結果

- -

{{EmbedLiveSample("Examples", '100%', 50)}}

- -

仕様書

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName("CSS4 Selectors", "#id-selectors", "ID selectors")}}{{Spec2("CSS4 Selectors")}}
{{SpecName("CSS3 Selectors", "#id-selectors", "ID selectors")}}{{Spec2("CSS3 Selectors")}}
{{SpecName("CSS2.1", "selector.html#id-selectors", "ID selectors")}}{{Spec2("CSS2.1")}}
{{SpecName("CSS1", "#id-as-selector", "ID selectors")}}{{Spec2("CSS1")}}初回定義
- -

ブラウザーの互換性

- -

{{Compat("css.selectors.id")}}

diff --git a/files/ja/web/css/id_selectors/index.md b/files/ja/web/css/id_selectors/index.md new file mode 100644 index 0000000000..6557f2663b --- /dev/null +++ b/files/ja/web/css/id_selectors/index.md @@ -0,0 +1,83 @@ +--- +title: ID セレクター +slug: Web/CSS/ID_selectors +tags: + - CSS + - Reference + - Selector + - Selectors +translation_of: Web/CSS/ID_selectors +--- +
{{CSSRef}}
+ +

CSS の ID セレクター (ID selector) は、 {{htmlattrxref("id")}} 属性の値に基づいて要素と一致します。選択される要素の id 属性は、セレクターで指定した値と完全一致していなければなりません。

+ +
/* id="demo" のついた要素 */
+#demo {
+  border: red 2px solid;
+}
+ +

構文

+ +
#id_value { スタイルプロパティ }
+ +

なお、これは次の{{Cssxref("Attribute_selectors", "属性セレクター")}}と等価です (ただし、詳細度は異なります)。

+ +
[id=id_value] { スタイルプロパティ }
+ +

+ +

CSS

+ +
#identified {
+  background-color: skyblue;
+}
+
+ +

HTML

+ +
<div id="identified">これは特別な ID がついています!</div>
+<div>これは単なる普通の div です。</div>
+
+ +

結果

+ +

{{EmbedLiveSample("Examples", '100%', 50)}}

+ +

仕様書

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName("CSS4 Selectors", "#id-selectors", "ID selectors")}}{{Spec2("CSS4 Selectors")}}
{{SpecName("CSS3 Selectors", "#id-selectors", "ID selectors")}}{{Spec2("CSS3 Selectors")}}
{{SpecName("CSS2.1", "selector.html#id-selectors", "ID selectors")}}{{Spec2("CSS2.1")}}
{{SpecName("CSS1", "#id-as-selector", "ID selectors")}}{{Spec2("CSS1")}}初回定義
+ +

ブラウザーの互換性

+ +

{{Compat("css.selectors.id")}}

-- cgit v1.2.3-54-g00ecf