CSS .class selector
CSS selectors complete reference manual
Examples
Select and style all elements with class = "intro":
.intro
{
background-color: yellow;
}
{
background-color: yellow;
}
try it"
Definition and Usage
The.class selector is a style of all elements of the specified class.
Browser Support
All major browserssupport.Class selector
More examples
Examples
Style all <p> elements with class = "hometown":
p.hometown
{
background-color: yellow;
}
{
background-color: yellow;
}
try it"
CSS selectors complete reference manual