Design tips!
Save time and effort byusing some of our simple buteffective web design hints and tips on your site.

Essential !DOCTYPE declarations!

Any valid HTML document declares what version of HTML is used in the document. It does this by using a DOCTYPE (document type) declaration at the beginning of the file. Below are the common DOCTYPES that you should use depending on how your site is produced.

HTML DOCTYPES

HTML 4.01 specifies three document type declarations, so authors must include one of the following DTDs in their documents in order to validate. The DTDs vary in the elements they support.

HTML4 Strict

Use this when you know that your page doesn't use HTML4 elements and attributes that have been deprecated, and you're NOT using framesets.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">


HTML4 Transitional

This includes everything in the strict DTD plus deprecated elements and attributes too (most of which concern visual presentation). Use this if you're not sure of your HTML validity

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">


HTML4 Frameset

This Doctype includes everything in the transitional DTD, and covers framesets too. Use this when your web site uses framesets.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">


to top

XHTML DOCTYPES


XHTML 1.0 Strict

Use this when you know your markup is free of presentational formatting, which is accomplished via external stylesheets.

<!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">

Quick tip: Don't use this if your markup includes <font> tags, or <table> tags to control layout. Inside <img> tags, border, hspace, vspace and align attributes cannot be used.


XHTML 1.0 Transitional

Use this when your pages use HTML (presentation) features that are difficult to achieve with stylesheets, or were your visitors browsers may not understand Cascading Style Sheets.

<!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">

Quick Tip: This is likely to be the DEFAULT XHTML DOCTYPE until such time when all browsers support cascading style sheets

XHTML 1.0 Frameset

Use this when your web site uses framesets.

<!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Frameset//EN" "DTD/xhtml1-frameset.dtd">

For future refence, the W3C is working on a replacment for DTDs, with something called XML Schemas, so check the W3C site every now and then for updates.

to top

design tips

- : Site Map : -


What do they do?

!DOCTYPE declarations help to future proof your pages. By using the world wide web consortium standards, you can now produce validated HTML/XHTML to ensure that your pages will display in the majority of browsers for many years to come. These standards remove the need to update your pages every time a new browser version appears (in theory).


Using these standards, pages are built by seperating content from structure by using (X)HTML and cascading stylesheets. Currently the majority of sites on the net are built using tables for layout (or frames), but as the standards become more refined and supported by the browser companies, designers will switch to this (relatively) new way of working.


Producing pages with XHTML and stylesheets is a habit you should be getting into now, even if you still use tables for layout.