Document Structure Commands
All HTML documents need to have these basic commands. Failure to include them, or using them improperly can have unpredictable and unwanted results.
Page Index:
Document Start & End - html
Header - head
Title Bar - title
Meta Tags - meta
Body - body
Body Options - Options that change your page
Background Color
Text Color
Link Color
Visited Link Color
Active Link Color
Tiled Background
Fixed Background
Layout - Arranging page elements
Paragraph - p
Line Break - br
Horizontal Rule - hr
Horizontal Rule Options - Options that change your Horizontal Rule
Alignment
Size
Width By Pixels
Width By Percentage
No Shade
Document Start & End - html
Every HTML document should start with the command <html> and end with the command </html>. When begining a new HTML document it's best to put both commands in right then. This way you won't forget to close the document. So it would look like this:
Example HTML Document
<html>
</html>
Then place everything else between those two lines.
Header - head
The Header of your document is defined by the <head> and </head> commands. Do not place any document text in the Header. If you do, your body command's options will not function. Document text should only be in the body.
Example HTML Document
<html>
<head>
</head>
</html>
Nothing should go in the Header unless it is required to be there. Two commands that must be in the Header are the Title and Meta Tags commands.
Title Bar - title
The title of your document is what appears in the Title Bar at the top of the browser window. For example, if you look at the top of this window the title of this document is "Document Structure Commands".
The title command is <title> and </title>. The title you wish to appear should be surounded by these commands. The Title command must be placed in the Header section.
Example HTML Document
<html>
<head>
<title>My Webpage</title>
</head>
</html>
Meta Tags - meta
Meta Tags don't display in your document. They are comments and information about your document. Some search engines use these in their indexes. You don't need to use them at all. But if you do, they must go in the Header section.
The structure of a Meta Tag command is <meta name="?" content="?">. In place of the first question mark should be the name, (also known as the type,) of tag you want this Meta Tag to be. In place of the second tag should be the text or description of this tag. If you don't need a Meta Tag, don't use it. They add to the size of your files. This will increase the space required for your site, and the bandwidth they require. And they will take longer for people to download. These are all reasons to limit their use.
The most commonly used meta tags are the Description and Keywords. These are actually useful because a Search Engine that Spiders websites for it's index will use these for it's entries on your page.
Description Meta Tag
<meta name="description" content="???">
Some Search Engines will list this as the description in their index. Replace the ??? with your own description of your page.
Keywords Meta Tag
<meta name="keywords" content="???">
Replace the ??? with keywords. Some Search Engines will use this to help people interested in your subject to find your site. Say you put "banana" in yours. Anyone who types banana into a Search Engine will find your site, (and every other site that has that keyword.) Some websites used to try to load the dice by repeating the same keyword over and over. This used to make them appear closer to the front of any list. Now most Search Engines will delete and ban you for attempting this. And the popular engines don't work that way anymore.
Example HTML Document
<html>
<head>
<title>My Webpage</title>
<meta name="description" content="A website dedicated to fruit.">
<meta name="keywords" content="Fruit, Banana, Orange, Apple, Pear">
</head>
</html>
Body - body
All of your text, pictures and such go in the Body section. This is defined by the Body commands. They are <body> & </body>. All text, graphics as well as anything that doesn't have to go in the Header should go between them.
Example HTML Document
<html>
<head>
<title>My Webpage</title>
</head>
<body>
</body>
</html>
Options:
The default settings for the entire page are set within the Body command. When using multiple options place them all in the body command separated by a space.
Example HTML Document
<html>
<head>
<title>My Webpage</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
</body>
</html>
Paragraph - p
Divides paragraphs and places a small amount of space between them.
Command
<p> - Begin paragraph
</p> - End paragraph
Example HTML Document
<html>
<head>
<title>My Webpage</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>
Sample sample sample sample sample. Sample sample sample sample sample.
</p>
<p>
Sample sample sample sample sample. Sample sample sample sample sample.
</p>
</body>
</html>
Failing to close a paragraph with a </p> doesn't have dire consequences. Most browsers can handle just using the begin paragraph. But not closing is bad HTML.
Options:
The default settings for the entire page are set within the Body command. When using multiple options place them all in the body command separated by a space.
Line Break - br
Breaks the text at that point and begins on the next line with no space in between lines. Unlike most commands, this one is a "single". It doesn't have a matching turn off command.
Command
<br> - Line break
Example HTML Document
<html>
<head>
<title>My Webpage</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>
Sample sample sample sample sample. Sample sample<br>
sample sample sample.
</p>
</body>
</html>
Horizontal Rule - hr
places a line across the page as a divider.
Command
<hr> - Line break
Example HTML Document
<html>
<head>
<title>My Webpage</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>
Sample sample sample sample sample. Sample sample<br>
sample sample sample.
</p>
<hr>
<p>
Sample sample sample sample sample. Sample sample<br>
sample sample sample.
</p>
</body>
</html>
Options:
The default line is a single pixel thick and goes from one side to the other of the window.
Questions? Email the address at the right. |
|
Return to Guide Index
Return to Homebuilt Homepage's HTML Guide
Return to Homebuilt Homepage