November 2011
Intermediate to advanced
384 pages
13h 23m
English
As mentioned earlier, a pseudo-class is a list of predefined names that a web browser uses to match a specific structure of elements. In CSS2, the :first-child pseudo-class was introduced. In CSS3, the list was expanded to allow you to match new combinations and patterns of child elements.
The structural child pseudo-class matches the first-level descendents of a parent element:
element:first-child { ... }element:last-child { ... }element:only-child { ... }element:nth-child(counter) { ... }element:nth-last-child(counter) { ... }
element: first-child matches the first element, when the element specified is the first child found underneath its parent. If a different element is the ...
Read now
Unlock full access