- * universal selector
- , group selector
- [space] descendant selector
- . class selector
- > child selector
- + adjacent sibling selector
- [att] attribute selector
- : pseudo-class selector
[examples]
- [group selector] p, h1, h2, h3 { font-family: serif }
- [space, universal, attribute selectors] div p *[href]
- [pseudo-class selector] a:link
- [space, child, space selectors] div ul>li p
- [adjacent sibling selector] h1 + h2 { margin-top: -5mm }
- [class selector] h1.red { color: red }
//=== attribute selectors
[att] Match when the element sets the "att" attribute
[att=val] Match when the element's "att" attribute value is exactly "val".
[att~=val]
Represents an element with the att attribute whose value is a white space-separated list of words, one of which is exactly "val".
If "val" contains white space, it will never represent anything.
If "val" is the empty string, it will never represent anything either.
[att=val] Represents an element with the att attribute,
its value either being exactly "val" or
beginning with "val" immediately followed by "-"
[ref]
沒有留言:
張貼留言