computer torture.

HTML (Hyper Text Markup Language) authoring guide for clean code.

Last updated 5 Feb 2002

Principle.

Clean HTML is a requirement for the DOM (the Document Object Model) to function correctly. The DOM holds information about all the objects within an HTML document, and many aspects of browser behaviour depend on it. The only way a browser can build up a satisfactory DOM is if the HTML is well formed and clean.

Site level considerations

Site level points aid in the technical project management and minimise on multiple, unnescessary errors during development. The DOM extends to the entire site if javascript is used for site navigation.

Document level - "well formed-ness"

Tag (or element) level

These recommendations are looking forward to XHTML (eXtensible Hyper Text Markup Language). Adopting these now will ease the transition should it be nescessary in the future. They are not essential.

Validation

Validation is strongly recommended. Validation tests that HTML is well-formed, and complies with the document type. Validated HTML will generally render correctly on more browsers.

Validating CSS for errors and warnings will remove many layout problems. CSS can be validated at http://jigsaw.w3.org/css-validator/validator-uri.html

HTML and XHTML can be validated at http://validator.w3.org/

Resources

Author: sinister@computertorture.com

www.computertorture.com

Valid XHTML 1.0! Valid CSS!

Validate this page with w3.org