← Back to HTML & CSS, page 7

html-css-0133 · Easy fresher

Which small text-level elements such as time, abbr, mark, kbd and address do you use, and what do they add?

Text-level elements add meaning: time with a datetime value, abbr with the full form, mark for relevant text, kbd and code for input and code, address for contact details, and q or blockquote for quotes. Choose by meaning and style with CSS.

Full answer

Text-level elements add meaning to a few words inside a paragraph. They help assistive tools, search engines and browser features, and they have useful default styles.

  • time marks a date or time. The datetime attribute holds a machine-readable value, such as 2026-12-04 or 2026-12-04T10:30, while the text can be anything, such as "Friday". Tools can use it for calendars and rich results.
  • abbr marks an abbreviation. The title attribute holds the full form, and browsers draw a dotted underline. A tooltip from title is not reachable by keyboard or touch, so spell the term out at its first use too.
  • mark highlights text that is relevant right now, for example a search match. It is not for plain decoration.
  • kbd marks keys or input the user types, such as Ctrl + S. code marks code, samp marks sample output and var marks a variable. They use a monospace font by default.
  • address gives contact information for the nearest article or for the whole page. It is not for any postal address in the text.
  • q is a short inline quote, and the browser adds quotation marks. blockquote is for long quotes, with cite to name the source.
  • strong shows strong importance and em shows stress in speech. b and i are for style with no extra meaning, such as a product name or a technical term.
  • sup, sub and small are for superscripts, subscripts and fine print such as legal text.

Use the element that matches the meaning, then style it with CSS. Do not use strong just to make text bold, and do not skip the element because you can fake the look.

The time element carries a precise value for tools. The keys use a monospace font, the abbreviation has a dotted underline and the match has a yellow background by default. The address is shown in italics in most browsers.

Choose by meaning, and check the default styles for your design.

html
<p>The event is on <time id="t" datetime="2026-12-04T10:30">Friday morning</time>.
Press <kbd id="k">Ctrl</kbd> + <kbd>S</kbd> to save.
<abbr id="a" title="HyperText Markup Language">HTML</abbr> is simple.
Search result: <mark id="m">flexbox</mark> guide.</p>
<address id="ad">Write to <a href="mailto:hello@example.com">hello@example.com</a></address>

Run in Chrome 156 (headless) as a page; the snippet is wrapped in a minimal HTML document with doctype, charset and viewport meta tag. Two full runs gave identical results, and the measured values in the answer come from them.

Key points

  • time holds a machine-readable date in datetime.
  • abbr gives the full form, but spell it out too.
  • mark highlights relevant text.
  • kbd, code and samp mark input, code and output.
  • Choose by meaning, not by default look.

Common mistakes

  • Using strong or em only to change how text looks.
  • Relying on the abbr title as the only place where the full form appears.
  • Using address for any postal address inside an article.

Follow-ups

  • What is the difference between strong and b?
  • Why is the datetime attribute useful?

Tips

  • Pick three or four elements and say what each means.
  • Say that the choice is by meaning, and styles come second.