Beginning HTML

Our First Page

Now that you have a basic understanding of how tags work, lets start designing our very first webpage. Open up Notepad and save the blank document as C:\My Webs\article\index.htm (or similar). All simple HTML web pages end with an htm suffix and if you want a page to show up as your first page, then usually you have to call it something similar to index.htm

NB: Although there are exceptions to this htm suffix, we need not worry about these now.

Every page must start with an <html> tag to tell the browser that what follows is HTML and we would like it to process it appropriately. Similarly, every page must end with an </html> tag to tell the browser that the HTML is finished. So, it makes sense that the first thing you should add to each new page is the <html></html> tag pair.

HTML can be divided into two distinct sections, the header and the body. The header of the document contains configuration information for the browser, as well as scripts and other such data. The body of the document is where the text that you want the user to see appears. For now, we'll concentrate on the body of the document.

To tell the browser that what follows is the body of the document, we must use the <body> tag. To tell it that we've finished with the body we must use the </body> tag.

Now that you understand these concepts we can make your first page using the following code:

<html>
<body>
Hello world!
</body>
</html>

Insert this code into your text editor and save the file. Try opening the index.htm in your browser now.

There you go - your first webpage. You should just see the text Hello World!

An interesting point about HTML is that "white-space" is ignored. This means that you can put as many spaces as you like between tags and the effect is the same.

For instance, the code:

<html><body>Hello world!</body></html>

Does exactly the same as above. I just prefer to space my tags out in this way, so that I can read the HTML more easily. I'm sure you'll develop a system that suits your needs after a little while.

You might also like...

Comments

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“We better hurry up and start coding, there are going to be a lot of bugs to fix.”