Interview Question

What are grouping selectors?

Comma-separated selectors share the same declaration block.

💡 Concept ✅ Quick Revision 🎨 CSS

Answer

A selector list applies one rule to several selectors. • Selectors are separated with commas. • Each selector in the list is evaluated independently. • An invalid selector can invalidate a forgiving or unforgiving list according to its context.

💡 Simple Example

h1, h2, h3 { line-height: 1.2; }

⚡ Quick Revision

Comma-separated selectors share the same declaration block.