| Pattern | Meaning | Described in section |
|---|---|---|
| * | 任何標籤 | Universal selector |
| E | 元素E的標籤 | Type selectors |
| E F | 選擇E的後代標籤F | Descendant selectors |
| E > F | 選擇E的子標籤F(白話:選擇E的孩子,向下一代) | Child selectors |
| E:first-child | 選擇E的第一個孩子 | The :first-child pseudo-class |
| E:link E:visited |
:link連結前,:visited連結後 | The link pseudo-classes |
| E:active E:hover E:focus |
動態標籤 | The dynamic pseudo-classes |
| E:lang(c) | Matches element of type E if it is in (human) language c (the document language specifies how language is determined). | The :lang() pseudo-class |
| E + F | E的相鄰標籤F(等級為兄弟姊妹) | Adjacent selectors |
| E[foo] | 標籤屬性有foo | Attribute selectors |
| E[foo="warning"] | 標籤屬性foo的value=warning | Attribute selectors |
| E[foo~="warning"] | 標籤屬性foo的value=有warning類似的值 | Attribute selectors |
| E[lang|="en"] | Matches any E element whose "lang" attribute has a hyphen-separated list of values beginning (from the left) with "en". | Attribute selectors |
| DIV.warning | class=warning | Class selectors |
| E#myid | id=myid | ID selectors |
2010年10月27日 星期三
CSS選擇器
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言