Free HTML tutorial

HTML Text Formatting: Strong, Emphasis, Code and More

Learn the meaning of HTML text-formatting elements such as strong, em, mark, small, del, ins, sub, sup and code.

Choose formatting by meaning

HTML text elements describe the role of text. Browsers often give them a default appearance, but choose an element for its meaning rather than its visual style.

  • <strong> marks strong importance; <em> marks stress emphasis.
  • <b> draws attention without adding importance; <i> marks text in an alternate voice or mood.
  • <mark> highlights text relevant to the current context; <small> is for side comments or fine print.
  • <del> marks removed content; <ins> marks inserted content.
  • <sub> and <sup> mark subscript and superscript text; <code> marks a fragment of computer code.

Example

<p>Save the file using <code>index.html</code>.</p>
<p><strong>Important:</strong> keep a backup copy.</p>
<p>Water is H<sub>2</sub>O.</p>

Use CSS when you want to change appearance without changing the meaning of the text.

Examples