Skip to content | Change text size
 

HTML markup standards

Any markup tools may be used to customise the templates or to create web pages provided the following markup standards and guidelines are followed.

Ensure all web pages use an appropriate document type definition (DTD)

Documents must use a W3C-approved DTD. Either XHTML 1.0 Transitional or HTML 4.01 Transitional are permitted.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">

Markup should validate against the DTD used

Markup should be syntactically correct and should be validated against these DTDs.

After customising the templates, they should be validated before being made available to web authors. Web authors using customised templates should validate all pages and correct any errors.

A suitable online validator is the W3C validator.

Avoid using deprecated markup

Avoid using deprecated markup elements such as <center>, <strike>, or <u>. A list of deprecated elements is provided by the W3C.

Where possible (taking into account the behaviour of Netscape 4), avoid using deprecated attributes such as align="", bgcolor="". The W3C provides a list of deprecated attributes.

Structural markup must be used

See using HTML tags properly

Markup style

Developers customising templates or those using text-style HTML editors should follow these style guidelines. Users of authoring tools such as Dreamweaver and FrontPage should follow as many of the guidelines as possible.

Use lowercase

All markup and attributes should be written in lower case. This is required for documents to validate against the XHTML DTD. It should also be used for HTML DTDs to enable a smoother transition to XHTML in the future.

Wrong: <P>This is a paragraph with <STRONG>important text</STRONG>.</P>
Right: <p>This is a paragraph with <strong>important text</strong>.</p>

Enclose attributes in quotation marks

Attributes should be enclosed in quotation marks. This is required for documents to validate using XHTML DTDs and recommended practice for those using HTML DTDs.

Wrong: <table width=100%></table>
Right: <table width="100%"></table>

Use comments

Use HTML comments to show the page structure and mark important elements. This improves readability and can assist when correcting faulty markup.

<!-- H E A D E R -->

Encode special characters

Ensure that special characters are properly encoded. Take particular care when cutting and pasting from word-processed documents.

" = &quot;
& = &amp;
© = &copy;

Resources