Text formatting in HTML – Bold, Italic, Underline

In this post you will learn the basics of text formatting in html document. Text formatting basically means all the operations which you can perform on the text. For example, make the text bold, italic, underline, etc.

In the previous tutorials we learned how create a hyperlink out of simple text.
We created the hyperlink of our desired text by placing the text within the opening a tag ( <a> )and closing a tag ( </a> ). In the similar way to perform any other operation on the text, we can place the text between the respective tag.

If you didn’t understand any of the above, just forget it.
You will understand with examples given below.

1. Now suppose if you want to bold the text, then you need b tag as shown below:

[html] <strong> 1st text goes here </strong> [/html]

2. If you want to italic the text, then you need i tag as shown below:

[html] <em> 2nd text goes here </em> [/html]

3. If you want to underline the text, then you need u tag as shown below:

[html] <span style="text-decoration: underline;"> 3rd text goes here </span> [/html]

Now lets place all these in one single html document:

[html]

<strong> 1st text goes here </strong>
<em> 2nd text goes here </em>
<span style="text-decoration: underline;"> 3rd text goes here </span>

[/html]

It would result into something like this :

HTML Tutorial 5 – Text formatting basics and Line Break

Leave a Reply