HTML Example

A HTML page contains the text you want the browser to display plus commands telling the browser how to handle special wishes like words in bold or italic letters. Please click on this link to see the text of a small example.
Now, when you click on this link, you can see how the same text will be interpreted and displayed by a browser.

Let's quickly go through the lines to get an impression how that works. Any HTML document begins with a html tag and ends with a closing html tag, so that the software knows what this is all about. A HTML document consists of a head part and a body part. The head part tells the browser general information about the document. In our example, the title of the document is set to 'HTML tutorial'. The title will be displayed in the Title bar of the browser when the document is viewed. The title information is in this example the only thing in the head section. Notice the need for closing the head and title tags.

Much more interesting is the body section. Here's the real content. First you output a heading 'Martians have landed'. The number behind the h indicates the size of the heading: 1 is the biggest.
Then you output the text of your article. To put the words National Inquisitor in italics, you enclose them between i-tags (i for italics). Other useful tags are u for underline and b for bold.

Normally, you don't handle line breaks, the browser does it for you. If you want to force a line break at some point you insert a br tag. Paragraphs can be created be using the p tag.

You want to include a picture of our favourite alien, and you do so by putting an img tag in the text. The src parameter in the tag gives the name of the file you want to display, and you use the width and height parameter to specify how big the picture should be painted there.

And that concludes the short overview.


Back to the offer page