HTML Text Formatting

HTML text formatting elements are extremely useful for defining text with a special meaning. These elements were designed to display special types of text. All the elements included below are Inline.

HTML Text Formatting Tags

Tag Description
<b> Defines bold text.
<strong> Defines strong text.
<i> Defines italic text.
<em> Defines emphasized text.
<mark> Defines marked or highlighted text.
<small> Defines small text.
<del> Defines deleted text.
<ins> Defines inserted text.
<sub> Defines sub-scripted text.
<sup> Defines super-scripted text.

Browsers have built-in style sheets for defining text. The example below is showing some existing elements how they look like.

Example Try this Code
<p><b>This text is bold</b></p>
<p><strong>This text is strong</strong></p>
<p><i>This text is italic</i></p>
<p><em>This text is emphasized</em></p>
<p>This is <mark>Marked</mark> text</p>
<p>This is <small>Small</small> text</p>
<p>This is <del>Deleted</del> text</p>
<p>This is <ins>Inserted</ins> text.</p>
<p>This is <sub>Subscripted</sub> text</p>
<p>This is <sup>Superscripted</sup> text</p>
Note: Although <strong> and <b> tags, and <em> and <i> tags are appeared as same style but the <strong> and <em> tags are used to force the words or phrases. So the <b> and <i> tags should be used only for highlighting words.

HTML Quotation and Citation Tags

Tag Description
<abbr> Defines an abbreviation or acronym.
<address> Defines contact information for the author/owner of a document.
<bdo> Defines the text direction.
<q> Defines a short inline quotation.
<blockquote> Defines a long quotation.
<cite> Defines the title of a work.
<dfn> Represents the defining instance of a term.

HTML Computer Code Tags

Tag Description
<code> Defines programming code.
<pre> Defines preformatted text.
<kbd> Defines keyboard input.
<samp> Defines sample output from a computer program.
<var> Defines a variable.