HTML Formatting Tag Summary

HTML formatting elements mark small pieces of text as important, emphasized, highlighted, or set apart from nearby words.

<p>This sentence has <strong>important</strong> text.</p>

Formatting elements are usually inline elements. They fit inside a sentence without starting a new block.

Strong And Emphasis

Use <strong> for text with strong importance. Browsers usually show it in bold.

<p><strong>Warning:</strong> Save your work before closing the page.</p>

Use <em> for emphasized text. Browsers usually show it in italics.

<p>You should <em>always</em> test the page after editing it.</p>

Bold And Italic

The <b> element draws attention to text without saying it is more important. The <i> element sets text apart in a different voice or style.

<p>The product name is <b>Code Kit</b>.</p>
<p>The word <i>bonjour</i> means hello in French.</p>

For beginner work, <strong> and <em> are often better choices when the text has real importance or emphasis.

Mark, Superscript, And Subscript

The <mark> element highlights text that should stand out in its context.

<p>Search results found <mark>three matching lessons</mark>.</p>

The <sup> element raises text above the normal line. The <sub> element lowers text below the normal line.

<p>This is my 1<sup>st</sup> web page.</p>
<p>Water is written as H<sub>2</sub>O.</p>

CSS Controls The Exact Appearance

HTML formatting elements add meaning to text. CSS can still change the exact color, weight, style, or background used to display that meaning.

Interactive Demo

This word is bold.

This word is italic.

This word is highlighted.

Water is H2O and four is 22.

Code Sandbox

AI Tutor