One of the biggest problem people have with html is forgetting to close tags. This causes
the page to look completely different then intended. Most beginners and even some experienced web designers just
find it easier to add extra tags to correct for forget the closing tags. Most commonly this is done with the font
tag. This is a bad practice under any situation. You should always remember to close tags. Sometimes this is
difficult so what we do is indent our code. Whenever you open a tag the lines below it should be indented.
When you close that tag you reduce the indentation. This is an easy way to remind yourself to close tags.
It also has another important function. It helps you close the tags in the right order. If you open tag 1 then
open tag 2 you should not close tag 1 before tag 2, EVER. In Internet Explorer you will probably not notice any
difference but in other browsers it will cause problems. This will save you hours of confusion as to why your
webpage looks different on different browsers.
Another coding style convention that I like to follow is to write all the tags and attributes
in capital letters. There is not technical reason for this. It just makes HTML significantly easier to read.
Picking out the tags from the page's text is much easier. After hours of looking at HTML I find it very useful
for it to be in all caps. The following is good HTML code.
<HTML>
<HEAD>
<TITLE>Test Page</TITLE>
</HEAD>
<BODY>
<B>This text would be bold</B>
</BODY>
</HTML>
When setting attributes in a tag the value should always be in quotes. Even numbers should
be enclosed in quotes. Most browser will recognize the values if they are not contained in quotes but for
compatiblity reasons quotes should always be used.