Example
Select and style all <h1> elements AND all <p> elements:
h1, p
{
background-color: yellow;
}
Try it Yourself »
Definition and Usage
To style several elements with the same style, separate each element name with a comma.
Version: | CSS1 |
---|
Browser Support
Selector | |||||
---|---|---|---|---|---|
element,element | Yes | Yes | Yes | Yes | Yes |
CSS Syntax