HTML - the basics

Get a free website here

Brackets

All HTML tags are enclosed within < > brackets. Anything that is written between the < and > brackets will be invisible, and not appear on your page.

Case Sensitive

HTML tags are NOT case sensitive. So, <body> is the same as <BODY> is the same as <Body>. However, if you go on to use XHTML coding, you must always use lower case.

Opening and closing tags

Almost all HTML tags have an opening and a closing tag. For example, the opening tag, <body> causes all text and graphics that appear after the tag to be centered in the page. Everything will remain centered until the closing tag </bodyr> is used.

Format

All HTML documents should follow the same basic format - otherwise some tags may not work properly.

The basic format for all HTML documents should be:

<html>This is a html document</html>

<head>This is a heading</head>

<title>This is a title</title>

<body>This is the body</body>

Head: Head tags surround the title and the introductory text.

Title: This should describe the content of the page. It should be descriptive, but less than 64 characters. Bookmarks pick up on your page title. An example of a poor title would be "Recipes". A better title would be "Low cholesterol recipes".

Body: The main part of your page goes between the <body> and </body> tags.

Closing tags: You must remember your closing tags. In some browsers, the document will still function without some of them. With others, it will not.

Different browsers

Not all HTML tags are supported by all browsers. If a tag is not recognised by a browser, it will simply ignore it. Some browsers are text only and will not support images, some will not support tables or frames.

View/source

Have you ever seen a page you liked and wondered "how do they do that?"

To find out, simply click on the VIEW option of your browser toolbar and then select SOURCE or DOCUMENT SOURCE. This will open a window that shows you the actual HTML code that was used to create the page you are looking at. You can then scroll through and find out the exact coding that you need.

Spacing

HTML documents take no notice of any line breaks or paragraphs that you type into your text. You have to write a specific command for line breaks and for paragraphs.

Line Breaks


This starts a new line

Paragraphs

This misses one line and starts a new line.

If you add the following tag:

<p align="right">This will send the text to the right</p>,

The text will form on the right hand side of the page.

Bold letters

<b>

This tag causes the letters to be bold. You must always close with the </b> tag.

Italics

<i>

This tag causes the letters to be italicised. You must always close with the </i> tag.