Thuta Learning
HTML
BasicWeb DevelopmentBeginner

B, I, Strong, Em

HTMLLesson 1020 min

What you'll walk away with

  • Use <strong> for text that is important, serious or urgent
  • Use <em> for the word you would stress aloud, and explain how it changes the meaning
  • Tell apart <b> for keywords and product names from <i> for terms, foreign phrases and thoughts
  • Move decoration that carries no meaning into a class and CSS

Explain it simply

Explain it simply

When you talk to a friend, warning them "don't touch the stove!" is different from stressing one word in "I never said that". HTML expresses these differences with tags: <strong> for something important, <em> for a stressed word.

<b> and <i> are for text that should stand out without being important, such as a product name, and for text in a different voice, such as a scientific name or a foreign word. The browser shows all four as bold or italic, but the meaning behind them differs.

Problem → Why → Solution

The problem: tags chosen for their looks

On an online shop, a developer reached for whatever tag made text bold: <strong> for prices, <b> for a safety warning. Later a designer added one CSS rule, strong { color: #b00020; }, to make warnings red. Every price on the site turned red, while the real warning stayed black.

product.html
<p>Electric kettle, 1.7 litres. Price: <strong>$25</strong></p>
<p><b>Do not</b> open the lid while the water is boiling.</p>
<p><i>New:</i> free delivery this week.</p>

Why did that happen?

The tags were chosen by appearance, not meaning. CSS, screen readers, reader modes and translation tools all trust what a tag means. A rule meant for "important text" hit the prices and missed the warning because the markup said the opposite of the truth. Choose tags by meaning and you can restyle safely later.

Core concept: same look, different meaning

<strong> marks importance, seriousness or urgency: a warning, a deadline you must not miss, the key part of a paragraph. Nesting <strong> inside <strong> raises the importance further. <em> is stress emphasis: the word you would stress when speaking. In "I never said she stole the money", moving <em> to a different word changes what the sentence means.

<b> and <i> are old tags, but HTML5 gave them meanings of their own; they are no longer "pure styling". <b> is for text you want to draw attention to without adding importance: a product name in a review, keywords in a summary. The spec calls <b> a last resort when no other element fits. <i> is for text in an alternate voice or mood: a technical term, a scientific name such as Camellia sinensis, a foreign phrase, a character's thought. For a foreign phrase, add a lang attribute so screen readers can pronounce it properly.

By default, browsers show <strong> and <b> in bold and <em> and <i> in italics. Most screen readers do not change their voice for <strong> or <em> with default settings, but the meaning is still present in the accessibility tree and available to reader modes, translation tools and your own CSS. So the test is not "will a screen reader stress it?" but "does the markup tell the truth?".

When there is no meaning at all and you only want a look, such as a bold uppercase label on every card, use none of the four: write <span class="label"> and set font-weight in CSS.

Mental model: four questions in order
  1. Important or a warning? <strong>
  2. Stressed when read aloud? <em>
  3. Different voice or a term? <i>
  4. Just stands out? <b>; decor? CSS

Ask from the top and stop at the first "yes".

General pattern

html
<strong>important, serious or urgent text</strong>
<em>the word you would stress aloud</em>
<i lang="language-code">term, foreign phrase or thought</i>
<b>keyword or product name, no extra importance</b>
<span class="name">pure decoration, styled in CSS</span>

All four are inline elements, so they sit in the middle of text inside a paragraph. lang is only needed for foreign phrases, and span is a hook with no meaning at all.

Example: each tag used for its meaning

Four paragraphs, each using one tag where it genuinely fits. On screen you see two bold and two italic phrases; in the markup you can read four different reasons.

formatting.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Text-level semantics</title>
</head>
<body>
  <p><strong>Warning:</strong> unplug the kettle before cleaning it.</p>
  <p>I <em>never</em> said she stole the money.</p>
  <p>The <b>Golden Leaf</b> blend is our best seller.</p>
  <p>Tea comes from the plant <i lang="la">Camellia sinensis</i>.</p>
</body>
</html>

Code breakdown

  1. Line 8<p><strong>Warning:</strong> unplug the kettle before cleaning it.</p>

    A safety warning is important, so <strong> it is. A CSS rule targeting strong to colour warnings red now hits exactly the real warnings.

  2. Line 9<p>I <em>never</em> said she stole the money.</p>

    Stressing "never" means "I did not say it at all". Move <em> to "she" and the sentence now suggests someone else did it.

  3. Line 10<p>The <b>Golden Leaf</b> blend is our best seller.</p>

    The product name should stand out, but it is not important or a warning, so <b> fits.

  4. Line 11<i lang="la">Camellia sinensis</i>

    A Latin scientific name is text in another voice. lang="la" tells the browser and screen readers that these words are Latin.

You should see
Four lines appear. "Warning:" and "Golden Leaf" are bold; "never" and "Camellia sinensis" are italic.

How <em> shifts meaning, and CSS-only styling

MarkupWhat the reader understands
<em>I</em> never said she stole it.Someone else said it
I never said <em>she</em> stole it.Someone else stole it
I never said she <em>stole</em> it.Maybe she only borrowed it

All three rows use exactly the same words; only the position of <em> changes. That is why <em> is never sprinkled at random: it is a deliberate choice that pins down what the writer means. Human translators and translation tools can use it to decide which word to emphasise in the new language.

For decoration without meaning, use a class and CSS. In the example below the price is bold and blue, but because it is not a <strong>, the strong rule written for warnings no longer touches it.

price.html
<style>
  strong { color: #b00020; }
  .price { font-weight: 700; color: #1a4fa0; }
</style>
<p>Electric kettle, 1.7 litres. Price: <span class="price">$25</span></p>
<p><strong>Do not</strong> open the lid while the water is boiling.</p>

In real projects

Where this shows up in real projects

In most rich-text editors the B button produces <strong> behind the scenes and the I button produces <em>. In Markdown, **text** becomes <strong> and *text* becomes <em>. So most content coming from a CMS is full of strong and em, and how the site's CSS styles those tags matters.

Documentation sites often mark UI labels in running text ("Click Save") with <b>, and introduce new terms with <i> or <dfn>. In design systems, the boldness of badges, labels and tags comes from classes and CSS, not HTML tags, so a component can change its look without touching meaning. On bilingual sites, markup like <i lang="my"> lets a screen reader switch to Myanmar pronunciation for that phrase.

Common mistakes

Common mistakes

1. Using <strong> whenever you want bold

Giving prices, names and labels <strong> waters down every "important" message on the page, and real warnings stop standing out. Use <b> for a product name and a class with CSS for pure styling.

2. Wrapping a whole sentence in <em> for italics

<em> is for the stressed word, not for turning a whole quote or caption italic. Stressing an entire sentence is the same as stressing nothing. For that look, use font-style: italic in CSS.

3. Leaving lang off a foreign phrase

Without lang, an English screen reader pronounces a borrowed word as if it were English. Adding lang, as in <i lang="my">...</i>, makes it clearer for listeners.

Best practices

Best practices

  • Before choosing a tag, ask "why should this text stand out?"; the answer picks the tag for you.
  • Keep <strong> to one or two uses per paragraph; when everything is important, nothing stands out.
  • Define repeated bold styles, such as card labels, badges and button text, once as a class in CSS.
  • Give every phrase in a language other than the page's a lang attribute; it works on a span too when you do not want italics.

Mini challenge

Mini challenge: mark up a product review

Write a short review of a rice cooker. Use each of the four tags once, for its real meaning, and style the rating with a class and CSS only.

  • <b> for the product name
  • <strong> for a safety warning
  • <em> on one stressed word
  • <i> with lang for a foreign word, and span.rating styled in CSS
review.html
<!-- Put this inside a full page (doctype, head with charset and title, body) -->
<style>
  /* TODO: style .rating (bold, a colour) with no HTML tag doing the work */
</style>

<!-- TODO: an <h1> heading for the review -->
<!-- TODO: a sentence naming the product with <b> -->
<!-- TODO: a sentence with one word stressed using <em> -->
<!-- TODO: a sentence with a foreign word in <i lang="..."> -->
<!-- TODO: a safety warning using <strong> -->
<!-- TODO: the rating inside <span class="rating"> -->

Expected: The product name and the warning are bold, the stressed word and the foreign word are italic, and the rating appears bold and coloured purely from CSS.

Show hint

Read each paragraph aloud. The word your voice leans on is the <em>; the text that is dangerous to skip is the <strong>.

Show solution
review.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Rice cooker review</title>
  <style>
    .rating { font-weight: 700; color: #b26a00; }
  </style>
</head>
<body>
  <h1>My rice cooker review</h1>
  <p>I bought the <b>SteamKing 500</b> for my family last month.</p>
  <p>It cooks rice <em>much</em> faster than my old pot.</p>
  <p>It even keeps the <i lang="my">ထမင်း</i> warm until dinner.</p>
  <p><strong>Never</strong> open the lid while it is still steaming.</p>
  <p>My rating: <span class="rating">4 out of 5</span></p>
</body>
</html>

Quick quiz 1 / 3

In "Do not touch the cable, it is live.", which tag should wrap "Do not touch"?

Quick quiz 2 / 3

In "The meeting is on Monday, not Tuesday." the speaker stresses "Monday". Which tag fits best?

Quick quiz 3 / 3

After adding strong { color: red; }, every price turned red. What is the root cause?

What to remember

  • <strong> means important, serious or urgent; <em> marks the stressed word.
  • <b> draws attention without importance; <i> marks terms, foreign phrases and thoughts.
  • Choose tags by meaning, not looks, so CSS can be changed safely later.
  • For decoration alone, use a span with a class and style it in CSS.

HTML Living Standard — WHATWG

Updated on

Progress is saved only in this browser on this device. It isn't synced to other devices.

Report a problem with this lessonOpens your email app with this lesson's address filled in — nothing is sent until you send it.

B, I, Strong, Em | Thuta Learning