Multiple Selectors
suggest changeWhen you group CSS selectors, you apply the same styles to several different elements without repeating the styles in your style sheet. Use a comma to separate multiple grouped selectors.
div, p { color: blue }
So the blue color applies to all <div> elements and all <p> elements. Without the comma only <p> elements that are a child of a <div> would be red.
This also applies to all types of selectors.
p, .blue, #first, div span{ color : blue }
This rule applies to:
<p>- elements of the
blueclass - element with the ID
first - every
<span>inside of a<div>
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents