HTML: Document Structure
Now that you have an understanding of one of the purposes of HTML tags, we should examine the structure of an HTML document.
When tags are used in pairs, they are easy to think of as containers. They contain and control the contents between them.
An HTML document consists of four main pairs of tags that contain information.
<html> .. </html>
HTML TAGS - All the content of the web page is placed between these two HTML tags. These tags serve to tell the browser what the document is and how to display it. It recognizes it as HTML and will display it as a web page.
<head> .. </head>
HEAD TAGS - The Head tags contain important information about the web document itself. Items that would normally be found here is the title of the web page within the TITLE TAGS, the META TAGS and JavaScript.
<title> .. </title>
TITLE TAGS - The TITLE TAGS are contained within the HEAD TAGS. The name of the web page is placed between the TITLE TAGS. Do not get this confused with the file name of the document (e.g. - index.htm). The title of the page should be meaningful, as it is what will appear in the bookmark or favorites list if the user chooses to mark it.
<body> .. </body>
BODY TAGS - Everything you see on the web page itself will be contained within the BODY TAGS.
Here is how all of these tags work together to create a very basic web page.
<html>
<head>
<title>My First Web Page</title>
</head>
<body>
My First Web Page
</body>
</html>
created: 2009-09-16 |