IE & Doctypes (esp for newbies)

Discussion in 'HTML' started by UKuser, Feb 4, 2009.

  1. UKuser

    UKuser Guest

    Hi folks,

    I just wanted to share a major discovery (for me) which after about 5
    years of web site building I didn't realise.

    If you use the HTML doctype for Transitional HTML then the page will
    render in Quirks mode (where the box model is broken). However (and
    this is the BIG discovery (for me)) - if you use a Strict HTML doctype
    then the page actually renders in Standards mode.

    I've never really spent long playing with DOCTYPEs to discover this
    and maybe just havent read that much about it - still applying hacks
    to my CSS to get it working with Transitional.

    I've read about triggering Quirks mode - but never realised (that
    including IE7) this could be done from the DOCTYPE parameter.

    Maybe I'll have to rethink my doctypes!

    A
     
    UKuser, Feb 4, 2009
    #1
    1. Advertising

  2. UKuser

    rf Guest

    UKuser wrote:
    > Hi folks,
    >
    > I just wanted to share a major discovery (for me) which after about 5
    > years of web site building I didn't realise.


    Oh my. Where have you been? :)

    > If you use the HTML doctype for Transitional HTML then the page will
    > render in Quirks mode (where the box model is broken). However (and
    > this is the BIG discovery (for me)) - if you use a Strict HTML doctype
    > then the page actually renders in Standards mode.


    Not quite. There is also "almost standards mode" and it does not entirely
    depend on transitional/strict, it also depends on the presence of a system
    identifier.

    You will, however, never get fully standards mode across all browsers, table
    cell hight being the problem.

    http://en.wikipedia.org/wiki/Quirks_mode

    > I've never really spent long playing with DOCTYPEs to discover this
    > and maybe just havent read that much about it - still applying hacks
    > to my CSS to get it working with Transitional.


    Why are you using transitional anyway? Are you transitioning from some
    legacy code?

    > I've read about triggering Quirks mode - but never realised (that
    > including IE7) this could be done from the DOCTYPE parameter.


    The doctype *is* what defines standards/quirks/almost mode.

    > Maybe I'll have to rethink my doctypes!


    Yep :)
     
    rf, Feb 4, 2009
    #2
    1. Advertising

  3. UKuser

    C A Upsdell Guest

    UKuser wrote:
    > I just wanted to share a major discovery (for me) which after about 5
    > years of web site building I didn't realise.
    >
    > If you use the HTML doctype for Transitional HTML then the page will
    > render in Quirks mode (where the box model is broken). However (and
    > this is the BIG discovery (for me)) - if you use a Strict HTML doctype
    > then the page actually renders in Standards mode.


    Not exactly true. Transitional with a URL will render in standards
    mode, or almost standards mode, depending on the browser. For details
    see http://www.upsdell.com/BrowserNews/res_doctype.htm
     
    C A Upsdell, Feb 4, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wendy Shuya

    Comments and DOCTYPES

    Wendy Shuya, Apr 1, 2004, in forum: XML
    Replies:
    2
    Views:
    397
    Richard Tobin
    Apr 2, 2004
  2. JWL

    Mixing doctypes

    JWL, Oct 13, 2006, in forum: HTML
    Replies:
    5
    Views:
    1,230
    David Dorward
    Oct 16, 2006
  3. Alf P. Steinbach

    How we recognize newbies as newbies

    Alf P. Steinbach, Aug 13, 2007, in forum: C++
    Replies:
    31
    Views:
    1,176
    Diego Martins
    Aug 21, 2007
  4. the.computational biologist

    including xml entities with their own doctypes

    the.computational biologist, Jul 21, 2011, in forum: XML
    Replies:
    5
    Views:
    1,320
    Joe Kesselman
    Jul 23, 2011
  5. Daniel Harple
    Replies:
    0
    Views:
    134
    Daniel Harple
    Dec 23, 2005
Loading...

Share This Page