A, B
A selector list: one rule for several selectors separated by commas.
Syntax
A, B { … }Examples
One set of styles for headings and a class:
<style>
h3, h4, .subtitle { font-family: Georgia, serif; color: darkslateblue; }
</style>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<p class="subtitle">A subtitle</p>Notes
If any selector in the list is invalid, the browser drops the whole rule. :is() with the same selectors is forgiving: it skips only the broken one.
See also
In the tutorial
- Selectors — How to pick elements for styling — by tag, class, id, nesting and attribute.