HTML and CSS Reference
In-Depth Information
:only-of-type (Only of Type Pseudo-class)
The only of type pseudo-class matches an element if it is the only
element of its type among its sibling elements. That is, it matches both
the :first-of-type and :last-of-type selectors.
:empty (Empty Pseudo-class)
The empty pseudo-class selects elements only when they contain no
child nodes. This includes text nodes and whitespace characters.
td:empty { background-color: rgb(80%,80%,80%); } /* shade any
empty table cells */
:not() (Negation Pseudo-class)
The negation pseudo-class allows you to select the case where elements
do not match the provided simple selector.
p:not(.note) {} /* paragraph elements without the class note */
input:not(:required) {} /* optional input fields */
td:not(:nth-child(odd)) {} /* not odd, or the equivalent of
:nth-child(even) */
Pseudo-element Selectors
Pseudo-elements are phantom elements that don't appear in the
HTML document but instead represent a part of the document that the
browser overlays on the document structure to represent properties of
the layout. For example, because of differences in font sizes, line lengths,
and devices, you cannot wrap the text that will appear on the first line of
a paragraph of text in a <span> tag with much accuracy. However, brows-
ers will place a phantom pseudo-element around just that first line of
text as if you did.
 
 
 
 
 
Search WWH ::




Custom Search