Thursday, August 27, 2009

html Vs xhtml

A DTD is a Document Type Definition, also know as DOCTYPE. In a document served as text/html, the DOCTYPE informs the browswer how to interpret the content of the page. If the the doctype is not declared, the browser assumes you don’t know how to code, and goes into "quirks mode". If you know what you are doing and include a correct XHTML DOCTYPE, your page will be rendered in "standards mode".

What is the difference between strict and transitional? Transitional allows deprecated tags and attributes to pass validation. The strict doctype is strict: depreciated tags and attributes will fail to validate under a strict doctype and may well display incorrectly as well

  • HTML 4.01 will fail to validate if you include XML style closing syntax on empty elements.
  • Strict DTD’ed documents will FAIL if you include deprecated elements and attributes.
  • In XHTML, there are no "empty attributes." All attributes must be in the form of name/value pairs.

Some interesting articles regarding this found here.