Q1. How is ID selector written?
ID selector uses # symbol: #header { }
Q2. What is the key characteristic of IDs?
IDs must be unique within a page - no two elements should have same ID.
Q3. What is the specificity of ID selector?
ID selectors have high specificity (100), much higher than class (10) or element (1).
Q4. Can an element have both ID and class?
Yes, element can have both: <div id="main" class="container">. ID for uniqueness, class for reuse.
Q5. When would you use ID vs class?
Use ID for unique elements like header, footer. Use class for reusable styles across multiple elements.
