From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../web/css/adjacent_sibling_combinator/index.html | 85 ++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 files/ja/web/css/adjacent_sibling_combinator/index.html (limited to 'files/ja/web/css/adjacent_sibling_combinator/index.html') diff --git a/files/ja/web/css/adjacent_sibling_combinator/index.html b/files/ja/web/css/adjacent_sibling_combinator/index.html new file mode 100644 index 0000000000..f962949f35 --- /dev/null +++ b/files/ja/web/css/adjacent_sibling_combinator/index.html @@ -0,0 +1,85 @@ +--- +title: 隣接兄弟結合子 +slug: Web/CSS/Adjacent_sibling_combinator +tags: + - CSS + - Reference + - Selectors + - セレクター +translation_of: Web/CSS/Adjacent_sibling_combinator +--- +
{{CSSRef("Selectors")}}
+ +

隣接兄弟結合子 (adjacent sibling combinator) (+) は2つのセレクターを接続し、同じ親{{DOMxRef("element", "要素")}}の子同士であって、1つ目の要素の直後にある2つ目の要素を選択します。

+ +
/* 画像の直後に来る段落 */
+img + p {
+  font-style: bold;
+}
+ +

構文

+ +
直前の要素 + 対象の要素 { スタイルプロパティ }
+
+ +

+ +

CSS

+ +
li:first-of-type + li {
+  color: red;
+}
+
+ +

HTML

+ +
<ul>
+  <li>One</li>
+  <li>Two!</li>
+  <li>Three</li>
+</ul>
+ +

Result

+ +

{{EmbedLiveSample("Example", "100%", 100)}}

+ +

仕様書

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName("CSS4 Selectors", "#adjacent-sibling-combinators", "next-sibling combinator")}}{{Spec2("CSS4 Selectors")}}名前を「次の兄弟」結合子に変更。
{{SpecName("CSS3 Selectors", "#adjacent-sibling-combinators", "Adjacent sibling combinator")}}{{Spec2("CSS3 Selectors")}} 
{{SpecName("CSS2.1", "selector.html#adjacent-selectors", "Adjacent sibling selectors")}}{{Spec2("CSS2.1")}}初回定義
+ +

ブラウザーの対応

+ + + +

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

+ +

関連情報

+ + -- cgit v1.2.3-54-g00ecf