HTML and CSS Reference
In-Depth Information
input[type=”checkbox”]:checked {
margin-left: 15px;
}
Notes on browser support
All major browsers, except our usual suspect, Internet Explorer, support the
UI element states pseudo-classes. If you consider that you are only adding
an extra level of detail and improved usability to your visitors, this can still be
an option.
6. CSS 3 structural pseudo-classes
:NTH-CHILD
The :nth-child() pseudo-class allows you to target one or more specific
children of a parent element.
You can target a single child, by defining its value as an integer:
ul li:nth-child(3) {
color: red;
}
This will turn the text on the third li item within the ul element red. Bear in
mind that if a di " erent element is inside the ul (not a li ), it will also be
counted as its child.
You can target a parent's children using expressions. For example, the
following expression will match every third li element starting from the
fourth:
ul li:nth-child(3n+4) {
color: yellow;
}
Search WWH ::




Custom Search