
What is doctype?
Doctype basically tells applications like your browser or online code validator what type of markup you’ve coded the page in. The majority of users will either use HTML or XHTML, Transitional or Strict versions. Transitional is used for old markup which has been coded for older browsers. Strict requires the markup to be well coded and standards compliant moving the page towards working with more browsers and screen readers.
Why do we need it?
If a browser is given a doctype it can interpret the markup you’ve used to render the page correctly. If it’s not given a doctype it will try to interpret the markup as best it can and therefor the page may not render correctly. For example: If IE6 isn’t given a doctype it works in ‘quirks’ mode and doesn’t honour CSS auto margins. If you start designing your pages with XHTML strict in mind you are giving yourself a helping hand to code more elegant, robust and standards compliant markup.
Where can I get it?
To add a doctype to your document it’s as simple as copy and paste. Below are the doctypes for XHTML transitional and strict. Paste them above your HTML tag in your document:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
To view more types of doctype to add to your document check out the W3C recommended list of doctypes.
For further reading I recommend:
University of Minnesota Web Design References
Transitional vs Strict Markup by Roger Johansson
Fix your site with the right DOCTYPE! by Jeffery Zeldman
If you found this helpful add me to your RSS reader! Thanks.
Tags: Accesibility, Browsers, Web Design

Hi, nice posts there
thank’s for the interesting information
Thanks Mike! Glad you enjoyed it.
Nice explanation!
thanks!
enjoy
Bindass Delhiite’s last blog post..Blogger Widget : Social Media Sharing