SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    78
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CSS hacks tutorials and whats "quirk" mode ?

    I know there are hacks explained in the sticky post, but I actually didnt undestand much of the ie hacks before reading about a fix in a friends of ed book..

    May you share your urls for hacks explained ? Both newbee and developer tutorials ?

    I would love a "hacks for real stupid dummies"

    ..and what is ie6 in "quirks" mode ?

    John M

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    IE5 got the so-called box model wrong. When you specify a width for something, and then add padding and/or a border, those should add to the specified width. The width is the width of the content. IE5 does it the other way round. It will subtract the padding and border from the width, so that the specified width will be the width of the outer box.

    Microsoft finally managed to get this right in IE6, but lots of web sites were already built where people thought that Microsoft's box model was right. In order not to break too many of those sites, IE6 uses something called doctype switching. Depending on how the doctype declaration looks, it will choose either a standards-compliance mode or a quirks mode.

    In the standards-compliance mode IE6 will handle the box model correctly. In quirks mode, it will emulate the incorrect behaviour from IE5.

    A full doctype, including a system identifier, will trigger standards mode. Anything else, including an omitted doctype, will trigger quirks mode. This is how it should look if you want standards mode:
    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    Birnam wood is come to Dunsinane

  3. #3
    Non-Member Egor's Avatar
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    7,305
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    And I've heard anything put above the doctype will also trigger quirks mode.

    Luckily there are hacks for ie 5 and 5.5 that fix the broken box model.

  4. #4
    SitePoint Enthusiast
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    78
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks I have understood the ie broken box hack ( finally ), and now I also understand the "quircks mode" - have really wondered why my ie6 was acting like a ie5

  5. #5
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mstwntd
    And I've heard anything put above the doctype will also trigger quirks mode.
    That's true. An XML declaration (for pretend-XHTML) or even an SGML comment before the doctype declaration will throw IE6 into quirks mode.
    Birnam wood is come to Dunsinane


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •