HTML - Document Tags
The first and last tags in a document should always be the HTML tags. These are the tags that tell a Web browser where the HTML in your document begins and ends. Everything in the document goes inside <HTML> and </HTML>. This is a non-empty tag.
The HEAD tags contain all of the document's header information. When I say "header," I don't mean what appears at the top of the browser window, but like the document title. HEAD section contains the information about the document. This information is communicated through the <TITLE> tag. This is a non-empty tag.
This container is placed within the HEAD structure. Between the TITLE tags, you should have the title of your document. This will appear at the top of the browser's title bar. What you type should probably be something which indicates the document's contents. This is a non-empty tag.
This tag identifies the main portion of the HTML document. BODY comes after the HEAD structure. Between the BODY tags, you find all of the stuff that gets displayed in the browser window. All of the text, the graphics, and links, and so on these things occur between the BODY tags. This is a non-empty tag.
The result of above example is the document with a completely blank browser window, but at least the words "Document Title" would appear in the browser.
<TITLE>Body Tag Attributes</TITLE>
<BODY alink=”red” vlink=”pink” link=”green”
background=”E:\Neeta\Images/vacuoles.jpg” bgcolor=”blue” bgproperties=”fixed” bottommargin=100 topmargin=200 leftmargin=250 rightmargin=300 scroll=no>
Various attributes of BODY tag are as follows:
alink: This attribute specifies the color of hyperlinks as they being clicked. Set it to a color value or a predefined color name.
link: This attribute specifies the color of hyperlinks that have not yet been visited. Set it to a color value or a predefined color name.
vlink: This attribute specifies the color of hyperlinks that have been visited. Set it to a color value or a predefined color name.
background: This attribute specifies the url of the image or graphic file to be used in tiling the browser’s background.
bgcolor: This attribute specifies the color of the browser as a background.
bgproperties: This attribute indicates if the background should scroll when the text does. If set to FIXED, the background will not scroll, only text will scroll.
bottommargin: This attribute specifies the bottom margin, the empty space at the bottom of document in pixels.
topmargin: This attribute specifies the top margin, the empty space at the top of document in pixels.
leftmargin: This attribute specifies the left margin, the empty space at the left of document in pixels.
rightmargin: This attribute specifies the right margin, the empty space at the right of document in pixels.
scroll: This attribute specifies whether a vertical scrollbar appears to the right of the document. Possible values are Yes (default) and No.
If you want to leave yourself notes in an HTML document, but don't want those notes to show up in the browser, you need to use the comment tag. To do that, use following:
<!-- text -->
<!-- Hi, I'm a comment. -->
Meta means about. This element is the place where you give information about your page. Search engines use the META element to help index your page. This element may only be used within the HEAD tag. It is an empty tag. The value of the content attribute depends on the http-equiv attribute.
<META http-equiv="Content-Type" content="text/html; charset=Windows-1251">
The above example sets the character set for the document.
<META http-equiv="REFRESH" content=2>
The above example causes the browser to reload the document every two seconds.
<META http-equiv="REFRESH" content="5; URL=http://www.sample.com/next.htm">
The above example causes the browser to load the new document, http://www.sample.com/next.htm, after a five second delay.
Various attributes are as follows:
http-equiv: It is a string value which is used to bind the content of the element to an HTTP response header. If omitted, the name attribute should be used to identify the meta-information. This attribute is not case-sensitive. Its value is refresh delay[;url] . The delay is the number of seconds that the browser waits before reloading a document. The optional URL specifies the document to reload. If no URL is given, the browser reloads the current document.
content: It is a string which specifies meta-information to be associated with the given name or HTTP response header.
charset: The character-set specifies one of the character set.