Making Text Bold, Italic, and More

Small tags that add emphasis to your words

6 min read

Headings and paragraphs give your page its skeleton of content, but sometimes you want to emphasize a word or phrase without making a whole new heading. HTML has small tags just for that, and they work right inside your paragraphs.

Strong: for important text

The <strong> tag makes text bold and tells the browser (and anyone using a screen reader) that this text is important. You use it right inside a paragraph, wrapped around just the words you want to stand out.

<p>Please remember: <strong>save your work often</strong>.</p>

Em: for emphasis

The <em> tag shows text in italics and signals emphasis, like the way your voice changes when you stress a word while speaking.

<p>I <em>really</em> enjoyed building this page.</p>

You can even combine them, nesting one inside the other, if a phrase needs both bold and italics:

<p><strong><em>Warning:</em></strong> this recipe is spicy!</p>

Code: for showing code or technical words

The <code> tag displays text in a monospaced font, the kind where every letter takes up the same width. It is meant for showing a bit of computer code, a file name, or a command, right in the middle of a normal sentence.

<p>To make a paragraph, use the <code>p</code> tag.</p>
Notice these tags all live inside a paragraph rather than replacing it. Think of strong, em, and code as spices you sprinkle into your sentences, not whole new dishes.

Why not just use bold in a word processor?

If you have used a word processor before, you might wonder why HTML bothers with "strong" instead of just "bold". The difference is meaning. Strong tells the browser and assistive technology that the text is genuinely important, while a purely visual bold might just be a style choice. Using the tag that matches your intent makes your page easier to understand for everyone, including people using screen readers.

As you build the pages ahead, try reaching for strong and em to highlight the phrases that truly matter, rather than wrapping entire paragraphs in them. A little emphasis goes a long way.

Quick check

Q1 Which tag makes text bold and marks it as important?

Q2 What is the <em> tag used for?

Want to save your progress? It's free.

Create a free account