The basic tags required for a html program are as follows:
<html> - First of all this tag is given to indicate the browser that this is a html program.
<head> - The next tag to be added for creating a title for the browser
<title> - Followed by head, the words included in the title tag will be the title of the webpage. </title>tag indicates that the tile is over. After that we are closing the </head> tag.
Note: Whether you give the title or not , these tags should be present in every html program.
<body> - The major content of the webpage will come under the body tag. </body> tag indicates that content is ended .
At last </html> tag tells the browser that the above html program is completed.
These <html>, <head>,<title>,<body> tags are followed by '/ 'with same words known as complementary or pair tags. It is no necessary that there should be complementary tag for each tag in the html program. There are some tags without any pair.
Let's see a program created using these tags in text editor like notepad.
File name : html- tags.txt
<html>
<head><title>Origin of Life</title></head>
<body>
Life is thought to have developed here on earth through a sequence of
chemical reactions over time. The most widely held hypothesis begins with
the formation of the sun and the planets, which coalesced from a cloud of
matter that resulted from a supernova, an old star that had exploded. Given
the same explosion and the same amount of time, the same sequence of
events would probably happen again, though the results might not be quite
the same.
</body>
</html>
The above .txt file is saved as .html and opened in a browser as a webpage.
| The text file is saved as .html |
The output:
Here , you can see that the title 'Origin of Life' as the title of the webpage. And the words given under body tag are displayed as content of the webpage.