is there a better syntax?
No. CSS’ or
operator (,
) does not permit groupings. It’s essentially the lowest-precedence logical operator in selectors, so you must use .a.c,.b.c
.
More Related Contents:
- Understanding CSS selector priority / specificity
- CSS Pseudo-classes with inline styles
- Why do browsers match CSS selectors from right to left?
- How can I select the last element with a specific class, not last child inside of parent?
- Can I write a CSS selector selecting elements NOT having a certain class or attribute?
- Are class names in CSS selectors case sensitive?
- Is there a CSS selector for the first direct child only?
- Why doesn’t table > tr > td work when using the child selector?
- CSS selector by inline style attribute
- :last-child not working as expected?
- :not(:empty) CSS selector is not working?
- How to exclude particular class name in CSS selector?
- Why is nth-child selector not working?
- CSS selector with period in ID
- CSS select elements with partial id
- Select first occurring element after another element
- CSS selector for empty or whitespace
- Is it possible to use CSS vars in CSS3 selectors?
- What is the ::content/::slotted pseudo-element and how does it work?
- Why does the general-sibling combinator allow toggling pseudo-element’s content, but not the adjacent-sibling?
- How can I target a specific column or row in a CSS grid layout?
- How do I select an element that has a certain class?
- Selecting the last element among various nested containers
- Zebra striping a flexbox table with wrapping items
- CSS attribute selector does not work a href
- How to use nth-child for styling with a table with rowspan?
- CSS Selector for No-Children-But-Not-Empty
- How to select classes with spaces
- CSS nth-match doesn’t work
- Targeting text nodes with CSS