News for October 2010

IE7 not displaying CSS background image

I ran into a problem while working on a site for a client, where the background image was not displaying in IE7 at all. I was pouring over forums and looking for a fix. I came across multiple “solutions”, but none of them worked.

After re-reading my code, I noticed a ‘typo’, if you will, in my code.

Original CSS code:


body {
background: #ccc url('../../img/bg.gif')repeat-x top;
}


The above code worked perfectly in all browsers EXCEPT IE. I noticed that there was no space following the img path declaration. I inserted a space and voila!
Working CSS code:


body {
background: #ccc url('../../img/bg.gif') repeat-x top;
}


Hope this helps some of you who have been stuck.

Posted: October 19th, 2010
Categories: code, tutorial
Tags: ,
Comments: No Comments.