liveBook · Manning

Text-level element

As explained in Web Design Playground, Second Edition

A text-level element is an HTML element that marks semantics or presentation for an inline span of text.

A text-level element marks the meaning or presentation of an inline span of text. Semantic HTML helps browsers and people reading your code understand what that text is doing. section 16.1

Common text-level elements give specific jobs to small pieces of content:

  • <abbr> identifies abbreviations; <cite> marks creative works; <code> marks programming code; and <dfn> marks a term's defining instance. section 16.1
  • <kbd> marks keyboard or other user input, while <samp> shows a program's output and <var> marks a variable. section 16.1
  • <mark>, <q>, <s>, <small>, <sub>, <sup>, <time>, and <u> handle highlighting, quotations, changes, notes, notation, dates, and underlining. section 16.1

A quotation with its source

<q>A fine quotation is a diamond on the finger of a man of wit, and a pebble in the hand of a fool.</q>—<cite>Joseph Roux, Meditations of a Parish Priest</cite> section 16.1

<abbr title="fear of missing out">FOMO</abbr>

See how the title attribute supplies the full meaning for an abbreviation such as FOMO. section 16.1

How Web Design Playground, Second Edition covers it

How deep it goes
Defines many HTML5 elements and demonstrates their syntax, without pursuing advanced edge cases.
Examples
Uses abbreviations, quotations, code, keyboard input, definitions, prices, chemical formulas, dates, and programming samples.
What you can do after
Apply HTML text-level elements to mark inline meaning, notation, input, output, citations, and dates.
How it connects
Connects semantic HTML with block-level elements, CSS, programming code, user input, quotations, and machine-readable time values.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Web Design Playground, Second Edition. The section links point to the parts of the book it draws on.