We are now ready to learn how to formate HTML text with the formatting element.
We can use some special elements for formatting output like:
<b> for bold text
<i> for italic text
<mark> for marked text
<ins> for text
<sup> for superscript text
<sub> for subscript text
<small> for smaller text
It is the time to apply our special elements for formatting HTML text and have a look how the browsers display it as below.
Let's change the default text of our HTML document to bold and italic.
<h2> <i> This heading is italic </i> </h2>
<p> <b> This paragraph is bold </b> </p>
<p> This paragraph is normal </p>
This paragraph is bold
This paragraph is normal
Let's change the default text of our HTML document to deleted and inserted.
<h2> Pen through the <del> word </del> </h2>
<h2> <ins> The </ins> water of this glass is pure </h2>
Let's change the default text of our HTML document to Superscript and subscript.
<h2> The 1 <sup> st </sup> May is labourday </h2>
<h3> The other name of H <sub> 2 </sub>O is life </h3>
Let's change the default text of our HTML document to marked and smaller.
<h3> There are many <small> small </small> island in Bangladesh </h3>
<h4> Notice the <mark> marked </mark> word attentively </h4>
Note: The background-color attribute,
tag supported in older versions of HTML but they are not valid in (latest version) HTML5. Font-family, font-size, text-align etc are the CSS property and the value of them are also the CSS value.
We will try to learn more about CSS in the next chapter.