Common HTML mistakes and new standards

2008/03/07 - bugs

March 7th 2008

Among the vast array of websites on the internet, there are far too few that stand out in the efforts to be xHTML compliant. I am constantly disappointed when I find my favorite websites like slashdot.org don't quite make par when it comes to well-formed HTML. So here are a few tips to consider when designing your HTML document:

& <- ampersand

The most common mistake I see involves the ampersand. Always replace the ampersand with the HTML escape code. THIS INCLUDES IN THE href OF HYPERLINKS!!!!111one HTML can be considered a subset of XML, and XML has some basic requirements such as every start tag must have an end tag. The most common mistakes I see here are on image, input, and break tags. All these elements should end with />. The backslash closes the element. Here are a few examples of proper syntax:

“example”
``` Another problem that also occurs a lot is putting javascripts in the body of a page. There is never a need for this. Javascript code can always be abstracted away and the processing function should be placed in a ``` This causes the validator to think that the script code is just one big comment tag and it is not parsed. Come on you, you know you want to click it: This is a valid xHTML site I hope you can all go forth and be better xHTML writers!