HTML 5 Tutorial #9 - HTML Text Formatting

By @cj231/29/2018steemit

HTML Text Formatting

In the previous tutorial, we learned about the style attribute for changing the style of an element. In this tutorial, we're going to tackle about the HTML text formatting element. Formatting elements were used to display special types of text or defining text with a special meaning.

Here are some examples of HTML text formatting we can use.

<b> - Bold text
<strong> - Important text
<i> - Italic text
<em> - Emphasized text
<mark> - Marked text
<mall> - Small text
<del> - Deleted text
<ins> - Inserted text
<sub> - Subscript text
<sup> - Superscript text

HTML <b> and <strong> Elements

If you want to make your text bold without any extra importance, use <b> element.

Example.png

If you want to make your text strong with added semantic "strong" importance, use <strong> element.

Example.png

HTML <i> and <em> Elements

We can use <i> element to make our text italic without any extra importance.

Example.png

We can use <em> element to make our text italic with added semantic importance.

Example.png

You will get the same result or browsers will display <strong> as <b> and <em> as <i> but there's a difference in the meaning of these tags since <b> and <i> defines bold and italic text while <strong> and <em> means that the text is "important".

HTML <small> Element

Use <small> element for small text.

Example.png

HTML <mark> Element

Use <mark> element for marking or highlighting text.

Example.png

HTML <del> Element

If you want to make the text display like deleted or removed, use <del> element.

Example.png

HTML <ins> Element

If you want to make the text display like inserted, use <ins> element.

Example.png

HTML <sub> Element

We can use <sub> element for defining a subscript text.

Example.png

HTML <sup> Element

We can use <sup> element for defining a superscript text.

Example.png


HTML 5 Tutorials:

HTML 5 Tutorial #1 - Introduction
HTML 5 Tutorial #2 - HTML Editors
HTML 5 Tutorial #3 - HTML Basic
HTML 5 Tutorial #4 - HTML Elements
HTML 5 Tutorial #5 - HTML Attributes
HTML 5 Tutorial #6 - HTML Headings
HTML 5 Tutorial #7 - HTML Paragraphs
HTML 5 Tutorial #8 - HTML Styles

9

comments