Glossary

span

Also known as: <span>, span element, inline container
TechHTML

Definition

The generic inline container with no meaning of its own — the <div> of text — for styling or hooking a run of characters inside a line when no semantic inline element (<em>, <strong>, <code>, <time>, <abbr>, <a>) says what it is

The inline half of the same rule as <div>: reach for it last. An emphasis is <em>, a date is <time datetime>, a keyboard key is <kbd>, an acronym can be <abbr>, and each of those carries something a span does not. Where a span is right: a badge’s text, an icon’s wrapper, a visually hidden label (class=“sr-only”), a piece of a line that needs a color. The card on this site wraps the platform labels in badges that are spans, which is fine — they are decoration with text in them.

Tech

A run of text with no name. The inline elements that do have names are short and few; learn them, and the span is what is left.

Related Terms

  • a: Appearance
  • ?: Keyboard shortcuts