Lesson 2:  The HTML Tags

 

In order to format an HTML document, we use HTML tags. The HTML tag is case insensitive, <HTML> and <html> are the same. Most tags must start with an open tag and an end with a closing tag. For example: <H1>Heading 1</H1>. However, some of the  tags such as <IMG> do not required a closing tag.

Here is the summary of some basic tags:
 
 

Tags

Desciption

 

<html></html>

<head></head>

<title></title>

<body></body>

<h1></h1>

<b></b>

<i></i>

<u></u>

<br>

Tags which create the HTML document.

Tags which denote the first part of the HTML document.

Tags which define the title of the web page.

Tags which define the main contents of the HTML document.

Tags that indicate the headings. There are 6 headings, from h1 to h6.

Tags that display bold text.

Tags that display italic text.

Tags that underline the text.

Tag that indicate line break. No closing tag is required here.

 

Now, open the notepad in windows and type the following codes:
[You might also copy the codes and paste them into your notepad]
 
<html>
<head>
<title>My sample HTML document</title>
</head>
<body>
<h1><u>My sample HTML document</u></h1>
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
<h4>This is heading 4</h4>
<h5>This is heading 5</h5>
<h6>This is heading 6</h6>
<b> Bold text</b>
<br>
<i>Italic text</i>
<br>
<u>Underlined text</u>
<b><i>Bold and italic text</i></b>
<b><i><u>Bold, italic and underlined text</u></i></b>
<h1><i>Italic heading</i></h1>
<h3><u>Underlined heading</u></h3>
</body>
</html>
 

To save the file, click on the file menu and select Save As, change file type to All files, save the file as sample1.html in My document. (You might use different file name and folder)

To view the web page, start Netscape communicator or IE and open the above file.

[Click here to see the sample output]

 

[Back to Main Page]