Subscribe to our latest seo tips!
Home

TIP 85

Don't forget to add a doctype

There is not just one type of HTML, there are actually many: HTML 4.01 Strict, HTML 4.01 Transitional, XHTML 1.0 Strict, and many more. All these types of HTML are defined in their respective W3C specifications, but they are also defined in a machine-readable language specifying the legal structure, elements and attributes of a type of HTML.

Such a definition is called a "Document Type Definition", or, for short, DTD.

Tools which process HTML documents, such as Web browsers, need to know which DTD an (X)HTML document is actually using: this is why each (X)HTML document needs, at the beginning, a DTD declaration, such as:

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

Given its syntax, the DTD declaration is often called, for short, "Doctype".
Why?

Why specify a doctype? Because it defines which version of (X)HTML your document is actually using, and this is a critical piece of information needed by browsers or other tools processing the document.

For example, specifying the doctype of your document allows you to use tools such as the Markup Validator to check the syntax of your (X)HTML (and hence discovers errors that may affect the way your page is rendered by various browsers). Such tools won't be able to work if they do not know what kind of document you are using.

But the most important thing is that with most families of browsers, a doctype declaration will make a lot of guessing unnecessary, and will thus trigger a "standard" parsing mode, where the understanding (and, as a result, the display) of the document is not only faster, it is also consistent and free of any bad surprise that documents without doctype will create.

NEXT > .< BACK

 


Hobo SEO & Website Design Services

  • Award Winning Web Design
  • Useable, Accessible W3C Website Design
  • Joomla CMS Design & Development
  • Wordpress Blog Design & Development
  • HTML & CSS Web Design
  • E-Commerce Shopping Cart CMS
  • Hosting & Domain Management
  • Creative On-Page SEO (Optimization)
  • Website Text & Image Optimization
  • Internal Navigation Optimization
  • Relevant & Quality Link-Building Programme
  • Web Page SEO Consultation
  • Social Media Promotion & Networking
  • Corporate SEO & Online Reputation Management

Contact us

Hobo-Web LTD,
The Stables,
24 Patrick Street,
Greenock
PA16 8NB
Scotland
UK

Telephone 0845 094 0839
FAX 0845 868 8946