HTML Formatting: HTML contains several elements for characterizing text with a special meaning.
HTML provides several tags that you can use to make some content on your pages appear differently than to ordinary content, for instance, you can use the tag <b> to make the text bold, tag <i> to make the text italic, tag <mark> to feature the content, tag <code> to show a part of computer code, tags <ins> and <del> for marking editorial additions and cancellations, and more.
This text is bold
This text is italic
This is subscript and superscript
HTML Formatting Elements
Formatting elements were designed to show special type of text:
<b>– Bold text
<strong>– Important text
<i>– Italic text
<em>– Emphasized text
<mark>– Marked text
<small>– Smaller text
<del>– Deleted text
<ins>– Inserted text
<sub>– Subscript text
<sup>– Superscript text
HTML <b> and <strong> Elements
The HTML <b> element defines bold text, with no additional significance.
<b>This text is bold</b>
The HTML <strong> element defines text with strong significance. The substance inside is commonly shown in bold.
<strong>This text is important!</strong>
HTML <i> and <em> Elements
The HTML <i> elements defines a piece of text in an alternate voice or temperament. The substance inside is regularly shown in italic.
Tip: The <i> tag is frequently used to show a technical term, a phrase from another language, an idea, a boat name, and so forth
<i>This text is italic</i>
The HTML <em> element defines emphasized content. The substance inside is normally shown in italic.
Tip: A screen reader will articulate the words in <em> with an emphasis, using verbal stress.
<em>This text is emphasized</em>
HTML <small> Element
The HTML <small> element defines smaller text:
<small>This is some smaller text.</small>
HTML <mark> Element
The HTML <mark> element defines text that ought to be marked or featured:
<p>Do not forget to buy <mark>milk</mark> today.</p>
HTML <del> Element
The HTML <del> element defines text that has been erased from a document. Browsers will typically strike a line through erased text:
<p>My favorite color is <del>blue</del> red.</p>
HTML <ins> Element
The HTML <ins> element defines a text that has been embedded into a document. Browsers will as a rule underline embedded content:
<p>My favorite color is <del>blue</del> <ins>red</ins>.</p>
HTML <sub> Element
The HTML <sub> element defines subscript text. The subscript text appears half a character underneath the typical line and is at times delivered in a smaller textual style. Subscript text can be used for chemical formulas, similar to H2O:
<p>This is <sub>subscripted</sub> text.</p>
HTML <sup> Element
The HTML <sub> element defines superscript content. Superscript content appears half a character over the typical line and is now and again delivered in a smaller textual style. Superscript content can be used for references, as WWW:
<p>This is <sup>superscripted</sup> text.</p>
Thanks for reading! We hope you found this tutorial helpful and we would love to hear your feedback in the Comments section below. And show us what you’ve learned by sharing your photos and creative projects with us.