HTML Formatting

There are several HTML formatting elements through which we can change the appearance of text. The text to be format is written in between the opening and closing tag of that specific html element. Each HTML Formatting element is used for a unique purpose such as to make underline a text or to make text bold or italic and many more.

HTML Formatting Elements

Lets discuss HTML Formatting Tags below:

Tag Description
<b> Use to make text Bold
<i> Use to make text italic
<u>Use to Underline text
<em>To emphasize a particular text or phrase
<mark>To mark a sentence or word
<del>It Defines a text that has been deleted
<sup>Define Superscripted text
<sub>Define Subscripted text
<small>It define small text
<big>It define big text
<strong>Define important text
<ins>It define inserted text
Text Formatting Elements

Now we will see detail of all HTML Formatting tags one by one.

Bold Element

Html bold element starts with <b> and ends with </b>.It is use to make text bold without giving any extra importance to text. It has no importance to browser it is only use in presenting the text more dark to grab the attention.

<p>This is <b>Bold Text</b></p>

Strong Element

The strong element starts with <strong> and ends with </strong>.It also makes the text bold but gives an extra importance to text. The difference between bold and strong tag is that <strong> tag has some importance to search engine or web browser So, its better to use <strong> tag. Writing keywords inside the strong tag is recommended.

<p>This is <strong>Important Text</strong></p>
HTML Formatting

<em> and <i> Elements

HTML <em> and <i> both tags are use to make text italic. Although the visual representation of both elements are same but the semantic sense is different. <em> tag is particularly used to emphasize a specific phrase or word within a sentence and <i> tag only italicize the text without emphasizing the text .

<i>italic text</i>
<p>Just <em> do</em> it. Here the person reading text will pronounce the word do with an emphasizes </p>

<ins> <u> and <del> Elements

HTML <ins> and <u> both tags are use to underline the text. Although the visual representation of both elements are same but the semantic sense is different. <ins> tag is particularly used to underline a specific text which is inserted in document at a later date and <i> tag has no meaning it only underline the text.

The <del> tag is use to define a deleted text. Typically browser strike a line through deleted text. Mostly <ins> tag is use in combination with <del>tag.

<p>This is <u>red</u> color</p>
<p>My favorite color is <del>blue</del> <ins> red</ins>

<small> and <big> Elements

Html <small> element defines the small text and <big> element defines the big text.

<p>Normal Text</p>
<p><small> Smaller Text</small></p>
<p><big>Bigger Text</big></p>

<sub> and <sup> Elements

HTML <sub> element defines the subscripted element it appears half of character below the usual line So it can be used for writing formulas. <sup> element defines the superscripted element it appears half of character above the usual line So, It can be used for writing footnotes .

<p>H<sub>2</sub>O</p>
<p>CSS<sup>1</sup></p>
<p>This is <sub>subscripted</sub> and <sup>superscripted</sup> Text</p>

<mark>Element

HTML <mark> element is used to highlight a text.

<p>Always be <mark> positive</mark></p>

These all above elements are used for HTML Formatting.