質問するログイン新規登録

回答編集履歴

2

整形

2019/09/06 07:45

投稿

Lhankor_Mhy
Lhankor_Mhy

スコア37612

answer CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  ### 追記
9
9
  大雑把に言うと、CSS3では、セレクタは【単純セレクタ】【結合子】【単純セレクタ】【結合子】……の繰り返しで表現されています。
10
- >A selector is a chain of one or more sequences of simple selectors separated by combinators.
10
+ > A selector is a chain of one or more sequences of simple selectors separated by combinators.
11
11
  [Selectors Level 3](https://drafts.csswg.org/selectors-3/#selector-syntax)
12
12
 
13
13
  `.tabs-menu li`

1

追記

2019/09/06 07:45

投稿

Lhankor_Mhy
Lhankor_Mhy

スコア37612

answer CHANGED
@@ -3,4 +3,24 @@
3
3
  そうです。
4
4
 
5
5
  > 子孫結合子を利用したセレクターは子孫セレクターと呼ばれます。
6
- [子孫結合子 - CSS: カスケーディングスタイルシート | MDN](https://developer.mozilla.org/ja/docs/Web/CSS/Descendant_combinator)
6
+ [子孫結合子 - CSS: カスケーディングスタイルシート | MDN](https://developer.mozilla.org/ja/docs/Web/CSS/Descendant_combinator)
7
+
8
+ ### 追記
9
+ 大雑把に言うと、CSS3では、セレクタは【単純セレクタ】【結合子】【単純セレクタ】【結合子】……の繰り返しで表現されています。
10
+ >A selector is a chain of one or more sequences of simple selectors separated by combinators.
11
+ [Selectors Level 3](https://drafts.csswg.org/selectors-3/#selector-syntax)
12
+
13
+ `.tabs-menu li`
14
+ の場合、
15
+ 【.tabs-menu】【 】【li】ということです。
16
+
17
+ 【.tabs-menu】は単純セレクタのうちのクラスセレクタ、
18
+ 【 】は子孫結合子、
19
+ 【li】はタイプセレクタ、
20
+ とそれぞれ分解できます。
21
+ 「子孫セレクタ」という用語はCSS3ではなくなっている(と思う)のですが、CSS2からの歴史的な背景があり、子孫結合子が使われたセレクタを、「子孫セレクタ」と呼ぶことが多いです。
22
+
23
+ なので、
24
+ 「【.tabs-menu】【 】【li】は子孫セレクタですか?」と聞かれると、「まあ、そうですね」という回答になります。
25
+
26
+ 参考になりますでしょうか?