Always use lowercase for your HTML Tags
Don't use upper case. Upper case is bad (this can be hard to do if your like me and tend to write <I> and then </i> for closing:P).
<center><H3>Types of Staff</H3></center> <H4>Administrators: <i>SilverFox, Danmidas</i></H4>
Above: Bad Code
Below: Good Code
<center><h3>Types of Staff</h3></center> <h4>Administrators: <i>SilverFox, Danmidas</i></h4>
Use Self-Closing Tags
In html certain tags (ex. img, br, hr) didn't need closing tags. However its best to write them with something called self-closing tags.
This is a more normal, bad HTML code.<br><br>I'm not using self closing tags. <BR> Now I just used a capital one. Big bad-bad :P <hr>
Above: Bad Code
Below: Good Code
This piece of code is better. <br /> <br /> I just used self closing tags. <br /> and I didn't use a capital. <hr />
Make your Documents "well-formed"
Form them right.
<p>here is an emphasized <em>paragraph.</p></em>
Above: Bad Code
Below: Good Code
<p>here is an emphasized <em>paragraph.</em></p>
Might take you a while to pick up on thise one. In the first example the <p> was closed then the <em>. However that's over-lapping and it isn't good.
Always Quote
Some might have a problem with this thankfully I never have (writing the bad code in the example I found I had written it right without trying).
<td rowspan=3><br /> <a href=site goes here.net>
Above: Bad Code
Below: Good Code
<td rowspan="3"><br /> <a href="site goes here.net">
Always quote attributes.
DocType
Most of us use
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
I recommend using:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
This is the way to the future.
Thanks
EDIT: Added <center> to examples that didn't have a start tag.
Edited by SilverFox, 09 May 2007 - 04:50 PM.












