Lesson 11 of 51 · Module 2, lesson 5 of 9 · 4 min

Important and emphasised text

Mark text as important, emphasised, highlighted, changed, or above and below the line.

What you'll learn

  • How to mark text as important (<strong>) or emphasised (<em>)
  • The difference between <strong> and <b>, and between <em> and <i>
  • Other small text elements: <mark>, <small>, <del>, <ins>, <sub> and <sup>

Why this matters

In HTML you do not choose how text looks — you say what it means, and the browser picks a default look. This matters because your page is not only read by eyes. Search engines, translation tools and future tools read the meaning in your tags. And when you add CSS later, you can change the look without touching the meaning.

Important and emphasised

html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Soup tips</title>
</head>
<body>
  <h1>Soup tips</h1>
  <p><strong>Warning:</strong> the soup is very hot when it leaves the pot.</p>
  <p>Add salt at the <em>end</em>, not at the start.</p>
</body>
</html>

What you'll see: "Warning:" in bold, and "end" in italic (slanted) letters.

The page "Soup tips". The first paragraph starts with the bold word "Warning:". In the second paragraph, the word "end" is in italic.

  • <strong> means strong importance: a warning, a key fact. Browsers show it in bold.
  • <em> means emphasis: the word you would stress if you said the sentence aloud. It can change the meaning: "Add salt at the end" is different from "Add salt at the end". Browsers show it in italic.

A note about screen readers: most of them do not change their voice for <strong> or <em> with their standard settings. So never rely on bold or italic alone for something vital. Say it in words too — "Warning:" is clearer than bold text alone.

<b> and <i>: look without extra importance

<b> and <i> also make text bold and italic. The difference is meaning:

  • <b> draws attention to words without saying they are important — for example, key words in a summary.
  • <i> is for text in a different voice — a word from another language, a technical term, a thought.
html
<p>In Italian, soup is called <i lang="it">zuppa</i>.</p>

If you are not sure which to use: use <strong> for importance and <em> for stress.

Other small text elements

ElementMeaningDefault lookCode example
<mark>Highlighted, relevant hereYellow background<mark>soup</mark>
<small>Side comment, small printSmaller text<small>Prices may change.</small>
<del>Removed textA line through it<del>20 minutes</del>
<ins>Added textUnderlined<ins>25 minutes</ins>
<sub>Subscript: below the lineSmall and low, as in H₂OH<sub>2</sub>O
<sup>Superscript: above the lineSmall and high, as in 10²10<sup>2</sup>
html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Recipe update</title>
</head>
<body>
  <h1>Recipe update</h1>
  <p>Cooking time: <del>20 minutes</del> <ins>25 minutes</ins>.</p>
  <p>Use <mark>fresh</mark> tomatoes if you can.</p>
  <p>Water boils at 100 °C. The formula for water is H<sub>2</sub>O.</p>
  <p><small>This recipe was changed on 3 March.</small></p>
</body>
</html>

The page "Recipe update": "20 minutes" is crossed out and followed by an underlined "25 minutes"; the word "fresh" has a yellow background; the 2 in H2O sits below the line; the last sentence is in smaller text.

Try it yourself

  1. Select the "Recipe update" example and choose Try it.
  2. Mark the word "tomatoes" with <strong> and watch it turn bold.
  3. Change <del> to <ins> and see the line become an underline.

Common mistakes

  • Using <strong> or <b> for a heading. Bold text is not a section title. Fix: use a real heading, <h2> or <h3>.
  • Making a whole paragraph <strong>. If everything is important, nothing is. Fix: mark only the key words.
  • Relying only on colour or bold to say something vital. Some readers cannot see it. Fix: say it in words as well, such as "Warning:".
  • Using <sup> to make text small. It moves text up and changes its meaning. Fix: use <small> for small print.

Check yourself

  1. Which element marks a warning as important: <em> or <strong>?
  2. How would you write CO₂ (with the 2 below the line) in HTML?
  3. Do most screen readers change their voice for <em> by default?

Answers

  1. <strong>.
  2. CO<sub>2</sub>.
  3. No. That is why vital information should also be clear in the words themselves.

Next: sometimes your page quotes other people, uses short forms of long names, or gives contact details. HTML has an element for each.

Chat with us on WhatsApp