What is the difference between id and class attributes?
- id is unique and used for a single element.
- class can be used for multiple elements.
Example:
<div id="main-header"></div>
<div class="card"></div>
<div class="card"></div>
Key Takeaway:
Use id for specific targeting; class for grouping and styling.