Is it HTML?

Creating webpages and publishing them on the internet isn’t hard these days. Just take a normal .txt file, rename it to .html and you’ve got yourself an HTML page, or not? Well, not really, there is more to it.

In this small tutorial I’ll try to explain how you can make your page a more valid HTML page.

Is it HTML?

First of all, is your page an HTML page? An HTML page starts with <html> and ends with </html>. Everything needs to be within those two and there can only be one of each. The first thing after the HTML opening tag (<html>) is <head>. This is where all the information about your pages will be. None of this will actually be shown on your page. The only thing that needs to be here is the title. Between the <title> and </title> tags, you write your pages’ title. It is good practice to give each page a different title. After this, we need to close the HTML head with an </head>. Immediately after you closed it, you open the body tag (<body>). Nothing else can be in between head and the body. Now you put all of your content in and close the body tag (</body>). After the body tag comes the closing HTML tag (</html>), which should already be there. All of those tags can only be used once on your entire page.

You now have something like this:

<title>This is my page's Title</title>
All of my content comes here

This is your basic HTML structure.

Tags need to be closed

This is something, which is needed, but only a smaller portion of the non-professional webdevelopers do it. Tags need to be closed. What does this mean? Well, when you type a tag, like a paragraph (<p>) this is actually a container. You need to specify where this container starts and where it closes. Everything within a container belongs together and gets the attributes of that container. Closing a tag is done almost the same as opening it, you only add a slash (“/”) in front of the tag’s name. So a paragraph opens with <p> and closes with </p>. So if all is correct, your page should have just as much closing tags as it has opening tags (with the exception of about 3 tags).

Get rid of those old tags

A lot of pages today, still use old tags, that are depreciated for several years. It’s time to get rid of them, and update your pages.

use <div align="center"></div> instead
replace it by <strong></strong>
replace it by <em></em>
<s></s>, <strike></strike>, <font></font>
Should be replaced by stylesheets or <del></del> and <ins></ins>
Underlining should never be used, except for hyperlinks. Use stylesheets for that.

There are some other depreciated tags, but these are the most used. Note that most of these can be best replaced by using stylesheets.

Final note

There are more things you need to do in order to have a nice HTML page, but these things are a good start, escpecially because a lot of non-professional people, but also people who create webpages as a living do them wrong.

No Responses to “Is it HTML?”.

Leave a response