Basic Structure of a Web Page

All web pages are made up of text, images and other data contained within HTML tags. Think of those Russian matrushka dolls, where you open one up and there's another one inside it, and another one inside that one, and so on.

i. HTML

The outermost tag is the <HTML> tag. This is a container tag, and requires both an opening and a closing tag. It's the very first tag in your source code, and the very last. This just tells the browser that everything contained within it is meant to be read as HTML.

Each page is separated into two parts, the HEAD and the BODY.

ii. Head

<HEAD> is a container tag, and requires both an opening and a closing tag. You put things in the head that aren't displayed, but instead tell the browser certain things about the page, like who the author is.

The main thing that goes in the HEAD is the TITLE. <TITLE> is a container tag, and it puts whatever is inside it into the titlebar of the browser. This is also what will be displayed in the Bookmarks if someone bookmarks your page, so make it something descriptive.

iii. Body

The <BODY> tag is a container tag, and means that everything inside it is to be processed as HTML and displayed in the browser window.

The <BODY> tag has a whole bunch of attributes that it can take.

BGCOLOR is the color of the background.

TEXT is the color of the text.

LINK is the color that hyperlinked text will be.

ALINK is the color that hyperlinked text turns into when it's clicked on.

VLINK is the color that hyperlinked text turns into once you've visited the link.

BACKGROUND is where the source background image is located if you're using one.

Now take a look at the source code (View-Document Source).



previous next contents