This Stuff Never Goes Away
Way back in the day during the midst of the browser wars, Netscape and Microsoft gave birth to arguably their worst browsers of all time (NN4 and IE4). Not in the sense that these companies had never done worse, but in the sense that they had never strayed so far from a W3C standard. As a result web developers started to do some pretty funky stuff with CSS to get documents to render in these browsers.
When standards compliance became a little more important browser manufacturers had some interesting choices to make. If they moved closer to the W3C standards they risked breaking a lot of sites, but if they kept down the track they were going, authoring a web site that leveraged any of the growing CSS features would become increasingly frustrating (and it was already pretty bad).
The solution was two fold.
- Allow web developers to specify a document type which would dictate the rules that should be used to render their html document. An example of a document type would be: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- If there's no document type available, or if the html that's given breaks the declared document type then render in the old way (quirks mode).
Because of the above quirks mode is slightly different on most browsers, mostly because there's no spec for quirks mode. There's a whole web site dedicated to Quirks Mode. You can also get a fuller story on Quirks Mode history here.
Back To Our Story
The short version of our story is that the document that our web application (SharePoint in this case) was handing out htmls that was breaking the doc type and because of this the page was rendering in quirks mode.
One of the worst things about Quirks Mode is that you can't always see it coming. If you download the Web Developer Tools extension, FireFox will tell you when a document is rendering in Quirks Mode, but IE is a little harder to catch.
So How do You Fix It?
When it comes to Quirks Mode you can really only do two things to get it back into Standards Compliance Mode.
- Ensure that there's a doc type at the beginning of the document and that you're familiar with the rules of that doc type.
- Ensure that the markup you're building up is compliant with the declared doc type.
When it comes time to troubleshooting and finding the delinquent html you can try SharePoint Designer or Visual Studio which will inspect a document and throw warnings when they find tags that break a document type that you can choose. That being said I've really yet to find a silver bullet for these issues. It's most frustrating when the markup is coming from a control or a page section that you don't even have control over!
Well at least we know WHY the document is rendering funny. Maybe that'll help someone sleep at night.
Hope That Helps,