Creating Your HTML Document

An HTML document contains two distinct parts, the head and the body. The head contains information about the document that is not displayed on the screen. The body then contains everything else that is displayed as part of the web page.

The basic structure of ANY HTML page is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
< html>
< head>
< title>Look Here!!!1</title>
< /head>

<body>

<!-- all the HTML for display -->
: :
: :
: :
</body>
</html>

The very first line: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> is not technically required, but is a code that tells the browser what version of HTML the current page is written for.

Enclose all HTML content within <html>...</html> tags. Inside is first the <head>...</head> and then the <body>...</body> sections.

The <title>...</title> tags are not required, but they go inside the head if used. Look at the top left of this web browser, where it says LOOK HERE!!!! The head of this HTML document contains the line:

<title>Look Here!!!!</title>

Also note the comment tags:

<!-- comments go in here -->.

The text between the tags is NOT displayed in the web page, but is for information that might be of use to you or anyone else who might look at the HTML code behind the web page. When your web pages get complicated (like you will see when we get into tables, frames, and other fun stuff about 20 lessons from now!), the comments will be very helpful when you need to update a page you may have created long ago. Comments are used in almost ALL of the higher levels of programming.