Loading ...
Sorry, an error occurred while loading the content.

4139Re: [NH] background

Expand Messages
  • loro
    Oct 31, 2003
      Neil Felton wrote:
      >I certainly don't understand the pros and cons of URL in the doc type. Be
      >interested to hear some comments.

      It's browser trickery. When all browsers went for greater standard compliance they had to come up with something so legacy documents wouldn't render as a total mess in new browsers. Newer browsers have two rendering modes called Standards (or Strict) and Quirks Mode. When in Quirks Mode they emulate earlier versions of themselves. The first browser that did this used the doctype as a trigger for what mode to use. All the others of course followed suite but not necessarily in the same way. IMO it's all idiotic. Better would have been to invent a meta tag or something for the purpose. Anyway, basically a doctype declaration *with* a URL gives you Standards Mode. You can find a lot about this if you google for "doctype switching". Here are a few...

      Activating the Right Layout Mode Using the Doctype Declaration
      Doctype switching and standards compliance in Internet Explorer and Netscape
      Mozilla's DOCTYPE sniffing
      CSS Enhancements in Internet Explorer 6
      The Opera 7 DOCTYPE Switches

      >It was with the URL that the quirky code didn't work, so I reckon that's
      >probably a good thing. I mean how loose does one want to be? I am just about
      >entirely css now but some of my older pages are not....

      Yes, I think most people that even bother to use a doctype wants standards mode. Something that can be handy to know though is that if you put anything at all before the doctype line IE6 goes into quirks mode. It may be the XML declaration if you write XHTML or simply an ordinary comment. If one encounters on of IE6's nasty display bugs it often helps to put it in quirks mode. This way one can do that while keeping other browsers in Strict Mode. Of course IE then displays other bugs but that doesn't really matter since one has to take care of the old IE5.x bugs anyway. LOL

      Imagine how easy this would be if it wasn't for browsers!

    • Show all 5 messages in this topic