Interview Question

What are universal selectors?

The universal selector `*` matches all elements in scope.

💡 Concept ✅ Quick Revision 🎨 CSS

Answer

The universal selector matches every element in its selected namespace. • It is written as an asterisk. • It can be combined with other selector parts. • Broad universal rules should be used carefully because they match many elements.

💡 Simple Example

*, *::before, *::after { box-sizing: border-box; }

⚡ Quick Revision

The universal selector `*` matches all elements in scope.