HTML - Formatting
Have you ever used MS Word?
It actually gives you an option to make a text look bold or italics or even if you want to strike through a text, you can do that.
And if we want to achieve the same in HTML, how can we do that?
Well! This is where we come across one of the cool topic in HTML. That is Formatting.
What is Formatting in HTML?
As said earlier, formatting is a feature in HTML where we can make a text bold, italics, small e.t.c.
Let us see all the Formatting elements in HTML :
-
<b>
This tag is used to make the text bold.
-
<i>
This tag is used to make the text italic.
-
<strong>
This tag is used to tell the browser that its an important text.
-
<u>
This tag is used to underline a text.
-
<mark>
This tag is used to tell the browser that its a marked text.
-
<small>
This tag is used to make the text smaller.
-
<big>
This tag is used to make the text bigger.
-
<em>
This tag is used to make the text italic.
-
<sup>
This tag is used to make the text a Superscript text.
-
<sub>
This tag is used to make the text a Subscript text.
-
<ins>
This tag is used to make the text an inserted text.
-
<del>
This tag is used to display a Deleted text.
-
<strike>
This tag is used to strike through a text.
Now, let us see the detail use of the Formatting elements in HTML :
-
<b>
This tag is used to make the text bold.
Example :
<html>
<body>
<b>This is a bold text</b>
</body>
</html>
Output :
-
<i>
This tag is used to make the text italic.
Example :
<html>
<body>
<i>This is an italic text</i>
</body>
</html>
Output :
-
<strong>
This tag is used to tell the browser that its an important text.
Example :
<html>
<body>
<strong>This is a strong text</strong>
</body>
</html>
Output :
-
<u>
This tag is used to underline a text.
Example :
<html>
<body>
<u>This is an underlined text</u>
</body>
</html>
Output :
-
<mark>
This tag is used to tell the browser that its a marked text.
Example :
<html>
<body>
<mark>This is a marked text</mark>
</body>
</html>
Output :
-
<small>
This tag is used to make the text smaller.
Example :
<html>
<body>
<small>This is a small text</small>
</body>
</html>
Output :
-
<big>
This tag is used to make the text bigger.
Example :
<html>
<body>
<big>This is a big text</big>
</body>
</html>
Output :
-
<em>
This tag is used to make the text italic.
Example :
<html>
<body>
<em>This is a big text</em>
</body>
</html>
Output :
-
<sup>
This tag is used to make the text a Superscript text.
Example :
<html>
<body>
This is a normal text. <sup>This is a superscript text</sup>
</body>
</html>
Output :
-
<sub>
This tag is used to make the text a Subscript text.
Example :
<html>
<body>
This is a normal text. <sub>This is a subscript text</sub>
</body>
</html>
Output :
-
<ins>
This tag is used to make the text an inserted text.
Example :
<html>
<body>
This is a normal text. <ins>This is a inserted text</ins>
</body>
</html>
Output :
-
<del>
This tag is used to display a Deleted text.
Example :
<html>
<body>
This is a normal text. <del>This is a deleted text</del>
</body>
</html>
Output :
-
<strike>
This tag is used to strike through a text.
Example :
<html>
<body>
This is a normal text. <strike>This is a strik through text</strike>
</body>
</html>
Output :