Page 93 - TGPT_V5.0_C5_Flipbook
P. 93
Both opening and closing tags are same. The only difference is that the closing tag contains a
forward slash before the tag name. Most of the tags in HTML have opening and closing tags. A
combination of opening tag, content, and closing tag is called an element.
Basic HTML tags
HTML provides various tags such as <!DOCTYPE html>, <HTML>, <HEAD>, <TITLE>, <BODY>, and
many more. Let us discuss some tags in detail.
The <!DOCTYPE html> Tag
The <!DOCTYPE html> is not an element in HTML. It is a document type declaration that tells
the browser about the version of HTML. It is not case-sensitive which means you can write it into
uppercase or lowercase.
The <HTML> Tag
The <html> tag tells the web browser that the text contained between <html> and </html> is
a web page and can be viewed using a web browser (Google Chrome, Microsoft Edge, Mozilla
Firefox, etc.). Every web page coding must start with the <html> tag and end with the </html>
tag.
The <HEAD> Tag
The <head> tag defines the header area of your web page. The information inside the <head> tag
is used by the browser but is not displayed on the web page. It is a container tag used in pair as
<head> and </head>. Every web page’s code must have its header tag.
The <TITLE> Tag
The <title> tag tells the web browser that text contained between <title> and </title> is the text
that is not part of the web page. It will be shown on the Title Bar of your web browser. The use of
<title> tag is not mandatory. If you do not want to give title to your web page, you can skip it. Your
web browser will show the file name and its path as the title of your web page.
The <BODY> Tag
The <body> tag specifies the main content of the web page. The text and other elements contained
between <body> and </body> tags are displayed on the web page. It is a container tag.
The <Hn> Tag
Every chapter in a book has various headings and sub-headings. Here, in <Hn> tag n denotes the
levels of headings. The heading tags are used to give similar effect to your web page. These are
container tags with a start tag and an end tag. HTML can define up to 6 levels of headings from H1
to H6. H1 is the first level of heading and H6 is the last level of heading/sub-heading. Let’s create a
web page using heading tags.
Introduction to HTML5 91

