HTML DOCUMENT TAGS

Document Tags denotes the entire structure of an HTML document. Every HTML Document should have four tags. These four tags denotes the type of document and the main sections of the document. These tags are:

(i). <HTML>
(ii). <HEAD>
(iii). <TITLE>
(iv). <BODY>

(i) <HTML>

The <HTML> tag is the primary or main tag for the entire HTML Document. It indicates the source of an HTML Document. It tells the web browser that it is an HTML Document. Each HTML document must have a <HTML> tag and each HTML document must ends with closing tag </HTML>.
The following two elements are sub elements of an <HTML> tag.

  • <HEAD>
  • <BODY>

<ii> <HEAD>

The <HEAD> tag works as a container for all other header elements. It simply defines the header section of t he HTML Document. This is the first thing that appears after the initial <HTML> tag . Each <HEAD> tag should have a <TITLE> tag indicating the title of the document. Although it has a combination of following tags, in any order.

<LINK>

The <LINK> allows to link an external file, such as style sheet or JavaScript file.

<STYLE>

The <STYLE> tag is used to insert CSS rules within <HTML> document.

<SCRIPT>

The <SCRIPT> tag is used to insert JavaScript or Visual Basic script within the <HTML> document

<META>

The <META> tag contains information about the document, such as keywords and descriptions which are especially helpful for search applications.

(iii). <TITLE>

The <TITLE> tag is used to set a title for every HTML Document. The Title tag defines a title in the browser’s title bar. This element is a sub-element of the <HEAD> element. The <TITLE> tag should only contain text for the title and may not contain other elements.

(iv). <BODY>

The <BODY> comes after the <HEAD> tag. It defines the body section of HTML document . That means, it simply defines the document’s body. The <BODY> tag contains all the contents of an HTML document, such as text, hyperlinks, images, tables lists and so on.

<BODY> ATTRIBUTES

AttributesValueDescription
Alinkcolor_nameSpecifies the color of an active link in a document.
BackgroundURLSpecifies a background image for a document
Bgcolorcolor_nameSpecifies the background color of a document
Linkcolor_nameSpecifies the color of unopened inks in a document
Textcolor_namespecifies the color of the text in a document
VLinkcolor_namespecifies the color of visited links in a document.

Example:

<HTMl>
<HEAD>
<TITLE> TAGS OF THE DOCUMENT </TITLE>
</HEAD>
<BODY BGCOLOR="YELLOW"TEXT="RED">
Hi .. this is tarak from technosoft solutions<br>
Happy learning
</BODY>
</HTML>

After the execution of above HTML code, the output would be look like: