Webit Why bother? Help Make a website now
Step 1 Step 2 Step 3 Step 4

The simplest set of tags

Lets build a really simple webpage. Open a new blank file in a text editor or a text-based HTML editor if you have one. Don't use Dreamweaver or a graphical web page building program because it will do unexpected things to your HTML. Type this into your document:

<html>


</html>

The <html> tag tells the browser that it is an HTML document. It doesn't do anything else, but you still need it in all your HTML files.

Now, between the opening and closing <html> tags, add a <body> element:

<html>
  <body>
  
  </body>
</html>

Whatever you put in the <body> tag displays in the main window of your browser. There's nothing to see yet, because we haven't put anything inside the body tag. So lets put something in there:

<html>
  <body>
    Hello, I've just had a really big idea!
  </body>
</html>

Save this file on your computer with a name of: hello.html. Fire up your web browser, open a new window and drag the icon for your hello.html file into the browser window. You should see something like this:

Screenshot
View this HTML file

Notice that you don't see the tags in your browser. Also notice how the spacing and layout we used in our HTML file doesn't appear on the screen. Browsers ignore spaces, line-breaks and tabs in HTML files (well, anything more than one space that is). If your page didn't work, go back to your text editor and check that you haven't made any typing mistakes in your HTML. Are your tags closed properly? Have you missed out any brackets or punctuation? The only thing you don't need to worry about is spaces in your code. I've indented the code in my examples to make it easier to read; you might want to do the same, but your browser doesn't care either way.

Notice also how, back in our HTML file, the tags were nested; that is, the opening and closing <body> tags go in between the opening and closing <html> tags. If you were to write...

<html>
  <body>
    Hello, I've just had a really big idea!
</html>
  </body>

... your web page would not work. So it is very important to remember to nest your tags properly.