4-The Class Selector
Style multiple HTML elements through the class attribute. This is handy when you want to give the same type of formatting to a number of unrelated HTML elements.
.Highlight
{
font-weight: bold;
color: Red;
}
The class attribute can be reused a piece of CSS for many different purposes, regardless of the HTML element that uses the class.
Grouping and Combining Selectors
CSS also enables you to group multiple selectors by separating them with a comma. This is handy if you want to apply the same styles to different elements. The following rule turns all headings in the page to red:
h1, h2, h3, h4, h5, h6
{
color: Red;
}
Style multiple HTML elements through the class attribute. This is handy when you want to give the same type of formatting to a number of unrelated HTML elements.
.Highlight
{
font-weight: bold;
color: Red;
}
The class attribute can be reused a piece of CSS for many different purposes, regardless of the HTML element that uses the class.
Grouping and Combining Selectors
CSS also enables you to group multiple selectors by separating them with a comma. This is handy if you want to apply the same styles to different elements. The following rule turns all headings in the page to red:
h1, h2, h3, h4, h5, h6
{
color: Red;
}


