Sometimes backgrounds will be visible using firefox but not IE7 which makes you wonder…. why?
The reason is pretty simple. CSS needs to be perfect for IE to understand them.
A perfect example would be.
body{
background:#fff url(picture.jpg)no-repeat;
}
That piece of CSS will work on Firefox but not on IE7 (funny thing is that it MIGHT work on IE7 but it wont most of the time)
body{
Background-image:url('image.jpg');
Background-repeat:no-repeat;
Background-color:#fff;
}
This will on the other hand work. As you can see, they have the same content, just a different layout.
You can of course put it in one row but make sure to have the right format, otherwise you’ll still have the same problem.
body{
background:#fff url(picture.jpg) no-repeat;
}
As you can see, the only difference is the space between “.jpg)” and “no-repeat”
Try this page with both Firefox and IE7 and you’ll see that IE7 won’t show the background, but Firefox will.














Thanks. I was about to pull my hair out over a single space between the image url and no-repeat.
It doesn’t work for me.
This is my code:
.cel1 img{
background:url(bg.png)no-repeat;
padding: 2px;
}
Can you help me!
Hi Uva
Your code looks right, but as I said in my post, you need to be careful with the spaces. Make sure yo have a space between url(bg.png) and no-repeat and it will work
hi. For me didn’t work either but when i written separatly it has been worked.
thx
Thanks man! You totally saved me!
My pleassure