Tuesday, February 26, 2008

DOCTYPE

Reasons why we cannot move to xhtml at this stage:

Should we move to html 4.01?

  • If you are currently using html 4.0 and you want to move to html 4.01

Pros

  • W3C recommends that user agents and authors (and in particular, authoring tools) produce HTML 4.01 documents rather than HTML 4.0 documents.
    Reference:
    HTML 4.01 Specification
  • More browsers consider html 4.01 as 'almost standard' or 'standard' mode as opposed to 'Quirks' mode than html 4.0
    Reference:
    Quirks mode
  • If you are using W3C validator to validate page against html 4.0, then you cannot have "name" attribute on the form tag. Whereas html 4.01 is fine.
    Reference:
    W3C Markup Validation Services
  • Going through the changes between 4.0 and 4.01, cannot find any significant disadvantages of using 4.01
    Reference:
    Changes between 24 April 1998 HTML 4.0 and 24 December 1999 HTML 4.01 versions
  • Visual Studio 2008 does support html 4.01 validation, but does not support html 4.0 validation.

Cons

  • If we move to 4.01, most cm public pages needs to be tested, time is an issue, also HTML 5.0 is soon to be here, might be worth the wait.
    Reference:
    HTML 5

Sample Stuffs that cannot be validated by html 4.0:

  • Name attribute of the form tag cannot be validated, but we cannot remove it since it's crucial to have it for the javascript to work.
    Reference:
    Having problems validating these forms?
  • Control id start with underscore cannot be validated, but most viewstate's id starts with underscore. e.g. id="__VIEWSTATE"
  • Runat attribute of any HtmlControls cannot be validated. e.g. cannot be validated

For your information:

  • Browser Rendering Modes:
    S = Standards mode
    A = Almost standard mode
    Q = Quirks mode:
  • IE in quirks mode is meant to be backward-compatible with the Internet of the past.
  • When in standards mode, IE uses the W3C box model, but in quirks mode IE uses the Microsoft box model
  • Some CSS features don't work in quirk mode, but do work in standards mode. Aligning an element using the auto keyword in conjunction with the margin property is one such quirks mode incompatibility.
  • Comparison of document types
    Quirks mode
  • HTML 4.01 specifies three document types:
    1) HTML Strict DTD
    2) HTML Transitional DTD
    3) Frameset DTD
  • XHTML 1.0 specifies three XML document types:
    1) XHTML Strict DTD
    2) XHTML Transitional DTD
    3) XHTML Frameset DTD
  • Transitional vs. Strict Markup
  • CSS vs. Tables
blog comments powered by Disqus