CSS element,element Selector
Example
Select and style all <h2> elements AND all <p> elements:
h2, 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
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.