The <span> Element
<span> is the generic inline container — use it when you need to style or hook a portion of text but no other semantic element (<em>, <strong>, etc.) fits.
Styling inline without semantics
The concert starts at 8:00 PM and doors open at 7:00 PM. Early-bird tickets are $45; regular is $60.
The quick brown fox jumps over the lazy dog — the classic pangram used for font samples and browser acid tests.
New in v2.3: NEW real-time sync, BETA dark mode, and DEPRECATED localStorage fallback.
Span vs. semantic inline elements
| Need | Use |
|---|---|
| Just styling, no meaning | <span> |
| Important / strong emphasis | <strong> |
| Stressed emphasis (reading tone) | <em> |
| Stylistic offset without importance | <b> |
| Technical term, foreign phrase | <i> |
| Abbreviation with expansion | <abbr> |
| Machine-readable data | <data> / <time> |
Rule: reach for <span> last. If a semantic inline element carries the right meaning, use that instead — it helps screen readers and search engines understand the content.