07. HTML text formatting elements in English, HTML text formatting tags in English

HTML and CSS through English, HTML and CSS Lessons
HTML and CSS tutorial for beginners in English

Hello friends, welcome to KTL's HTML and CSS tutorial. Today we will study lesson 7.

In our previous lesson, we studied different methods of specifying colors in HTML. We also saw how to specify background color.

What are text formatting elements?

Today, we will see about text formatting elements. HTML uses special elements called text formatting elements. These elements are used to format text like making text bold, italics etc. Following are text formatting elements.

1. <b> - is used to make text bold.

2. <i> - is used to make text Italic.
3. <small> - is used to display text in smaller size.
4. <sup> - is used for superscript text.
5. <sub> - is used for subscript text.
6. <strong> - this is used for important text, but it displays same as <b> tag.
7. <em> - is used for emphasized text, but it displays same as <i>.
8. <mark> - displays text highlighted.

Other formatting elements are <del> for deleted text and <ins> for inserted text.

Text formatting elements in HTML script

Let us write a script using all these formatting elements. Open a new Notepad file. Write following in that file.

<!doctype html>
<html>
<head>
<title>
My HTML
</title>
</head>
<body>
<p>

Now write following for text formatting elements.

<p>
This is <b>bold text.</b><br /><br />
This is <i>italic text.</i><br /><br />
This is <u>underlined text.</u><br /><br />
This is a formula in algebra. (a+b)<sup>2</sup>=a<sup>2</sup>+2ab+b<sup>2</sup><br /><br />
Chemical formula of water is H<sub>2</sub>O<br /><br />
This is a <mark>very important</mark> rule in HTML.
</p>
</body>
</html>



HTML text formatting elements in English, bold, italics
Figure 7-1 HTML text formatting elements

Save this file as "Lesson-07". Again save as "Lesson-07.html". Click on the above figure for PDF file of source code. In windows explorer double click on HTML document.


HTML text formatting elements - output
Figure 7-2. Text formatting elements - output

See the output. Our formatting for different formatting elements is displayed. Click on figure 7-2 to see actual output in web page.

Important Points:

1. There are special formatting elements for text formatting.
2. These elements are written inside elements which are used for writing text.
3. These are used for bold text, italics text, superscript, subscript and so on.

Lesson-06                                                             Lesson-08