CSS element.class Selector
Complete CSS Selector Reference Manual
Example
Selects all
elements, and set the background color to yellow:
p
.hometown
{
background-color:
yellow
;
}
Try it »
Definition and Usage
element.class The selector combines an element selector and a class selector to select specific HTML elements with a given class attribute.
Reference .class Selector.
Browser support





All major browsers support element.class selector.
Complete CSS Selector Reference Manual