Multiple Selectors

suggest change

When 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 every <div> and every <p>. Without the comma, div p would select <p> elements that are descendants of a <div>, not every div and every p.

This also applies to all types of selectors.

p, .blue, #first, div span{ color : blue }

This rule applies to:

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents