Structure of an HTML Document
An HTML document consists of two major portions:
Head and Body
In the head section you specify some information about the document. For example, you can specify what will be the title of the document. The title of the document typically gets displayed on the top title bar on the browser when the browser window comes the top title bar displays the title of the document. So whatever you specify as title will come on the top. There is some additional Meta data you can also specify this we shall talk about later. Meta data actually specify some information about the contents. Like for example some of the keywords that is that your document contains. These are sometimes used by the search engines in order to provide indexing services. For example if you are searching Google for a page you give a keyword that means how to locate the page. So the periodically, Google look for pages, they look for Meta tags in the header. So if they find, they update their data indexing database.
In addition to head there is a body. Now in the body portion the actual matter of the document resides and it is the body which gets displayed within the browser window. The head is something which specifies the title and some other information. Body is something which gets actually displayed in the window.
A simple HTML Document
This is a very small example. This is a very rudimentary and a simple HTML document. You see this starts with a begin <HTML>, it ends with an end </HTML>. Now in most browsers, this begins <HTML> and end </HTML> are optional. This you can also omit. You can see there is a head section, there is a body section.
In the head section you have this begin <head> and end </head>. And within the head we have nested only one tag the title tag. Now within the title tag we have specified the title of the document.
Now in the body the first you have specified in the begin <body> tag. We have added some attribute, specifying that our text color will be white and our background color will be blue and the actual body of the document is this. This is the content of the document. This is some text which will come, this is an italic font you see there is a begin italic and an end italic. So the intermediate word is italic, this should come in the italic font. Now this particular HTML document when it gets displayed on the browser it will look something like this.
This is the content of the document. This is an italic font. You see that the italic is coming in the italic font and the background is blue and the foreground is white.