HTML contains defined elements for defining how text is formatted. HTML Formatting of text borrows from the traditional Word Processing tools.
HTML Formatting Elements
Here is a summary of HTML text formatting elements.
<b>– Bold text
<strong>– Important text
<i>– Italic text
<em>– Emphasized text
<u>– Underlined text
<mark>– Marked text
<small>– Smaller text
<del>– Deleted text
<ins>– Inserted text
<s>– No longer valid text
<sub>– Subscript text
<sup>– Superscript text
<b> element defines the bold text, without any extra importance.
<b>This text is bold</b>
<strong> element defines text with strong importance. Visually it is typically displayed in bold.
<strong>This text is important!</strong>
<i> element defines text in an alternate voice or mood. Visually it is typically displayed in italic.
<i>This text is italic</i>
<em> element defines emphasized text and is typically displayed in italic.
<em>This text is emphasized</em>
<u> element defines some text that is unarticulated and typically displayed underlined.
<u>This text is underlined</u>
<small> element defines the text that is one font size smaller than the surrounding text.
<p>This text is <smaller>smaller</small> than the rest.</p>
Marked or Highlighted text
<mark> element defines the text that should be marked or highlighted.
<p>Do not forget to <mark>highlight</mark> your ideas.</p>
<del> element defines the text that has been deleted from a document. Visually it is typically displayed with crossed-out text.
<p>The race covers <del>thirty</del> forty miles.</p>
<ins> element defines a text that has been inserted into a document. Major Web browsers will typically underline inserted text.
<p>His name is Jack <ins>Murphy</ins></p>
No Longer Valid Text.
<s> element defines the text that is no longer valid in the specified context.
<p>He win a truck <s>not a sedan</s> in the competition</p>
<sub> element defines subscript text. Subscript is the text that appears half a character below the normal line and is sometimes rendered in a smaller font. Subscript is ideal for formatting chemical formulas such as CO2.
<p>This is the formula for carbon dioxide CO<sub>2</sub></p>
<sup> element defines superscript text. Superscript is the text that appears half a character above the normal line and is sometimes rendered in a smaller font. Superscript can be useful in scientific formulas such as 92.
<p>This is the square root of nine: 9<sup>2</sup> = 3</p>
Check out the complete list of all available HTML tags in our HTML Tag Reference.