HTML basics: Reusable class names
Classes let multiple elements share presentation. IDs should identify a single element within a document.
Current edit
Understand the pattern
Classes let multiple elements share presentation. IDs should identify a single element within a document.
Classes let multiple elements share presentation. IDs should identify a single element within a document.
Misconceptions to reject
- A visual appearance alone guarantees the intended HTML meaning.
- Replacing semantic elements with generic divs automatically improves accessibility.
The preview is a sanitized subset, not a full browser compatibility test.
Worked example and expected result
<p class="notice">Workshop starts soon.</p>
<p class="notice">Bring a notebook.</p>
<p class="notice urgent">Doors close at ten.</p>Classes let multiple elements share presentation. IDs should identify a single element within a document.
Explain it
Apply it elsewhere
Keep the momentum.
Complete the lab, then explain and apply the pattern.
Review this courseTry an incident drillAnonymous lesson and mastery progress lasts for this session. Sign in to keep synced lesson XP between sessions; mastery stays device-local. No speed bonus, lost lives, or hint penalties.