CSS Selector list (,) Combinator
Example
Select and style all <h1>, <h2>, and <p> elements:
h1,
h2, p
{
background-color: gold;
border: 1px solid gray;
}
Try it Yourself »
Definition and Usage
The CSS selector list combinator (,) is used to
select all the matching elements. Separate each element name
with a comma.
| Version: | CSS1 |
|---|
Browser Support
| Combinator | |||||
|---|---|---|---|---|---|
| element1, element2, ... | Yes | Yes | Yes | Yes | Yes |
CSS Syntax