I'm using the <body>
tag as a wrapper for three divs on a site where every single background color is white.
I've set the background color to #fff for the html and body in the css, and the site is rendering correctly in every browser (including IE 6 and 7) except IE8:
I've even tried setting the style for html directly inline like so: <html style="background-color: #fff">
but that doesn't seem to change anything.
Not even sure what might be causing the bug.
The problem is the following property in your CSS:
:focus{
outline:0;
background-color:#f2f3f6;
border-color:#996
}
Apparently, on loading IE8 decides that the html
element has focus, whereas other browsers don't do this. Remove the background-color property here and it'll all stay white.
What happens when you insert this code into your HTML?
body div
{
background-color: white !important;
}
Normally, browsers interpret and apply the last line of CSS that they read to an element, so background-color: red; background-color: blue;
would result in a blue background color.
!important
tell the browser to ignore all other property re-decelerations, so background-color: red !important; background-color: blue;
would make the background color red, even though you told it to be blue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With