HTML Text Formatting

Using the text formatting tags you can make some text on your web pages to appear differently than normal text content.

HTML Formatting Tags

There are several tags exist in HTML to format text, like <b>, <i> etc. These formatting tags can make text bold, italic, sub/superscripted, and more.

  • <p><b>This text is bold</b></p>
  • <p><code>This is computer code</code></p>
  • <p><em>This text is emphasized</em></p>
  • <p><i>This text is italic</i></p>
  • <p><small>This text is small</small></p>
  • <p><mark>This text is marked</mark></p>
  • <p><strong>This text is strongly emphasized</strong></p>
  • <p>This is <sub>subscript</sub> and <sup>superscript</sup></p>
  • <p><ins>This text is inserted to the document</ins></p>
  • <p><del>This text is deleted from the document</del></p>

The <strong> tag normally renders as <b>, and <em> renders as <i>. However, there is a difference in the meaning of these tags.

 

Note:The <strong> and <em> tags are "logical" tags. Use these tags when the content of your page requires that certain words or phrases be stressed, and if you want highlighting words only for visual effect, use the <b> and <i> tags.


HTML Text Formatting Tags

Tag Description
<b> Defines bold text.
<del> Defines deleted text.
<em> Defines emphasized text.
<i> Defines italic text.
<ins> Defines inserted text.
<mark> Defines marked/highlighted text.
<small> Defines small text.
<strong> Defines strong text.
<sub> Defines subscripted text.
<sup> Defines superscripted text.

HTML Citations, Quotations, and Definition Tags

Tag Description
<abbr> Defines an abbreviation.
<address> Defines contact information for the author/owner of a document.
<bdo> Defines the text direction.
<blockquote> Defines a long quotation.
<q> Defines a short quotation.
<cite> Defines a citation.
<dfn> Defines a definition term.

HTML Computer Output Tags

Tag Description
<code> Defines computer code text.
<kbd> Defines keyboard text.
<samp> Defines sample computer code.
<var> Defines a variable.
<pre> Defines preformatted text.
 
Close

Your Feedback:

 

We would love to hear from you! Please say something.