|
Elements are essential
parts of any Web page. Without these elements, the page may not
function correctly at all (newer browsers can read pages missing
some of them, but its always a good idea to have them anyway).
The most basic Web
page you can create is made up only of the most crucial elements.
We've already seen the list of the most crucial elements when
you created your first Web page a couple pages back. Here is the
standard template again:
<html>
<head> </head>
<body> </body>
</html>
Given what we've seen
about nested tags in the previous slide, you can tell that the
<head> </head> and <body> </body>
tags are both affected by the <html> </html>
tag pair. Let's break these down to explain what they are:
<html>
</html> = Everything contained between these is part of
an HTML document.
<head>
</head> = Everything contained between these is part of
the page header
<body>
</body> = Everything contained between these encompasses
the rest of the page outside of the header.
The most common information to appear in the "document header"
is the title of the document, which is the title that is
displayed in the bar at the top of the browser window.
The title is written
in the document within the tag pair <title> </title>
It appears something
like this:
<head>
<title>Your Page Title Here</title>
</head>
Let's try modifying
the page we built earlier. Reopen the HTML file with Notepad or
SimpleText, and modify it so it looks like this:
<html>
<head>
<title>My First Web Page</title>
</head>
<body>
</body>
</html>
Save
the file and then reopen it by double-clicking on it. The top
of the resulting Web page should look something like this:

You'll
note the blue "title" bar of the Web browser now displays
My First Web Page.
The document
body, contained within the <body> </body> tags,
is the entire rest of the HTML document. Everything that appears
on the screen while the Web page is being displayed must be contained
within the document body.
Again, there are exceptions
to this, as we will see when we discuss frames, but for now, make
sure that everything except for the <html> tag pair or
anything that is in the document header is inside the <body>
</body> tags.
Let's add some basic
text to our Web page...
|