Search code examples
jquerycssinternet-explorerjquery-pluginsquirks-mode

Dealing with CSS Shapes and IE Doctype


I have been working on a jQuery plugin that involves CSS Shapes. The issue I have been coming across is that the CSS shapes do not work in IE8 if there is no DOCTYPE declared. This will be my first jQuery plugin.

My question: How do jQuery developers fix this issue? Should I just explain in the documentation that a DOCTYPE is required for this plugin to work or should I write separate CSS that works in Quirks mode?


Solution

  • Nobody intentionally omits a valid doctype these days - that causes Quirks Mode.

    http://hsivonen.iki.fi/doctype/

    You willfully want the Quirks mode - No doctype.

    Please don’t do this. Willfully designing for the Quirks mode will come and haunt you, your coworkers or your successors in the future—when no one even cares about Windows IE 6 anymore (already no one cares about Netscape 4.x and IE 5). Designing for the Quirks mode is a bad idea. Trust me.

    The only possible valid reason a site would not have a doctype is if it's a legacy site where it would take too much effort to fix it to work in Standards Mode.

    Your plugin simply does not have to work in Quirks Mode.

    You don't even have to mention it in your documentation. It's expected that things will break. For example, none of the new CSS3 stuff in IE9 works if the page is in Quirks Mode.