feature: selectors status: use tags: fallback gtie6 kind: css polyfillurls:
Most CSS Selectors are supported from IE7 onwards, so you should be safe to use them. But do note that, on browsers that do not support these selectors, a whole rule will be detected as invalid if these unsupported selectors are present. For example, in IE6 #main, p:first-child {}
would be invalid because it is unable to understand p:first-child
. We strongly recommend you do not try to polyfill this, but if you do need one, you can use Selectivizr.
tr > td
: Immediate descendant (child) selector.dt + dd
: next sibling selector*dt ~ dd
: any following siblingdiv[attr]
andimg[src$=png]
: Attribute selector (starts with, ends with, contains).p:first-child
*div:hover
and:hover
state on all non-<a>
'sli.food.vegetable
: without worrying about the chained classes bug
* IE7-8 don't update styles properly when elements are manipulated with JS. Usually you have to force the browser to redraw (e.g. hide and show parent element).
:before, :after
and generated content:focus
for elements with current focus
- These very useful selectors:
:nth-child(n)
,:last-child
,:target
,:not(s)
,:enabled
,:disabled
,:checked
,::selection
- These ones, too:
:root
,:nth-last-child(n)
,:nth-of-type(n)
,:nth-last-of-type(n)
,:first-of-type
,:last-of-type
,:only-child
,:only-of-type
,:empty