Pattern:
element.CLASSNAME
Definition:
The element.CLASSNAME selector matches every element that have a class attribute containing CLASSNAME. The CLASSNAME must immediately follow the ".".
When representing the class attribute, element.CLASSNAME and element[class~=CLASSNAME] have the same meaning.
Examples:
Assign styles to all elements with class="code"
1 | *. code { font-family : monospace ; } |
or simply
1 | . code { font-family : monospace ; } |
Style all <p> elements with class="note"
1 | p.note { color : yellow; } |
Style every <p> element whose class attribute has been assigned a list of whitespace-separated CLASSNAMEs that includes both animal and sky
1 | p.animal.sky { color : skyblue; } |
Please login to continue.