HTML and CSS Reference
In-Depth Information
Name
Class Selector
Pattern:
element1.classname
element1.classname1.classname2
Description:
In languages that permit it, such as HTML, XHTML, SVG, and MathML, a class selector us-
ing “dot notation” can be used to select elements that have a class attribute containing a spe-
cific value or values. The name of the class value must immediately follow the dot. Multiple
class values can be chained together, although there are support problems in Internet Explorer
previous to IE7. If no element name precedes the dot, the selector matches all elements bear-
ing that class value or values.
Examples:
p.urgent {color: red;}
a.external {font-style: italic;}
.example {background: olive;}
.note.caution {background: yellow;}
Note:
Internet Explorer previous to IE7 does not support the chained selector syntax, though it does
permit multiple words in class values in the markup.
Search WWH ::




Custom Search