Css – IE8 CSS Body background color

cssinternet-explorer-8

I have a page that works fine in most browsers(Safari, FF, Chrome, IE9) but on IE8 it won't show the body background color. It shows the Body bgcolor as white. In the Developer Tools, I see that it is overriding all the CSS and getting some background-color:#fff from somewhere.

I have my scripts (jquery 1.6.2) just before the closing tag as is suggested on the HTML5 Boilerplate (html5boilerpate.com) – not sure if not having the scripts in the head section causes this behaviour?

Anyone any ideas ? This is really weird.

Best Answer

A couple things to try.

  1. Toy with the load order of your css files. Whatever is loaded last will be the style if you don't specify !important
  2. Inspect your rendered html for inline <style/> blocks as they could be causing trouble and not show up in the style tab as a specific css file.
  3. When in doubt target background-color directly as background will sometimes be overridden by a background-color property body{background-color:#e6e6e6}
  4. If that doesnt work you could force override it with body{background-color:#e6e6e6 !important}.