HELP - Lesson 2 Page 1

Structure of a web page

Nomatter what you use to create a web page, or what the web page looks like, all web pages have a common structure as a starting point.

Choose File | New HTML Document.

Look at the document window - you should see something like:
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>

</BODY>
</HTML>

This is the very least that a web page should contain to be syntactically correct.

Try the preview button - a totally blank page?

Thats fine - you should see a blank white page, as the structure above is not intended to be seen. The words between the angle brackets are called HTML TAGS and form the instructions to Internet Explorer, and of course all other web browsers, to control the format and postion of the page contents.

These are special tags, each of which may only appear once per web page,and always in the order shown. They define the web page into two sections, the HEAD and the BODY. All of the web page contents will be placed in the BODY, and only special instructions for formatting, scripting etc may be placed in the HEAD.

Opening and closing tags

Every HTML tag must have a corresponding closing tag. (not strictly true in every single case, but a good rule to remember from day 1).
<HTML> is an opening tag.
</HTML> is a closing tag - note the forward slash before the word.

The area enclosed between the opening and closing tag is called an HTML ELEMENT

There are quite strict rules about which ELEMENTS can be placed inside other elements, which is called a DTD or Document Type Definition, and is controlled by the W3C - World Wide Web Consortium. To show that we recognise this and have not just invented our own standard, we can place one extra line before the opening HTML tag. This is the one and only tag which may be placed outside of the HTML element, and will vary slightly depending upon the type of compliance to the standard which we want to enforce. Take our word for it now - you will not need to worry about this for a long time, but place the following at the very top of your web page if you want to make it fully compliant to the standards.
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN"->

Copy it and paste it into the document now, and make sure the whole line is on a single line of its own too - it does not like being broken in half!
So your blank html document should now look like :

<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN"->
<HTML>
<HEAD>
etc.

Coming up next - adding some content to our blank page..

[ Next ]