CSS Background images not loading in IE7

IE7 apparently doesn’t render background images written with the ‘background’ property in CSS.
Can anyone help with a hack for IE 7 to make it show background images?
AND IE6 for that matter

Any help appreciated.

Site in question:

http://www.countrymechanical.com.au/temp/

It’s not called legacy mode Ralph, it’s called compatibility mjode :slight_smile:

Glad you got it fixed.

[ot]I saw that typo before I submittted my reply, and I decided to let it run just so I’d see if anything came of it :rofl:

It’s actually Norwayish[/ot]

Many thanks! that’s encouraging!
I’m testing for my client who has IE7.
It would be handy if I could put IE6 and 7 on my PC for testing - I tried to download IE7 but because I had IE8 already installed it wouldn’t allow me to install 7. Any ideas on how I can test on IE 6 and 7.
Cheers!

Hi, if background images aren’t appearing in all of IE, then I know what the error is, and it’s easiliy fixed (you probably forgot a space (example below)

background:url(fake.jpg)[b]no-repeat[/b]

There isn’t a space there and IE will ignore the rule

If it is just IE7, then try adding haslayout to that element because sometimes IE needs it, min-height:0 for example.

Bg images show up fine in IE6 and 7. Just tested your site in ie7 and it looks just like FF.

Have you done a page refresh, cleared cash etc?

Ryan,
Thanks for your help, think I have a fix now, please see me reply to ralph above.

Thanks again for your help, including the links. It seems it’s working now.
I did swap from ‘background:’ to ‘background-image:’ as well as ‘background-repeat:’ and ‘background-position’ etc. I think this may have made the difference.
I tested for IE7 at www.browsershots.org and the site rendered just fine.
Time to call it a fix I think :wink:

I tested IE6 too, and the bg images also appear there, so the site looks fine on all.

IE8 has a feature called something like “legacy mode” (I can’t remember, as I haven’t used it) which lets you view a page as IE7 would render it.

Other than that, you could install a virtual machine which will allow you to run multiple versions of IE, such as:

(http://ietester.com/)
http://www.vmware.com/solutions/desktop/
http://www.parallels.com/products/desktop/pd4wl/
http://www.microsoft.com/downloads/details.aspx?FamilyID=04d26402-3199-48a3-afa2-2dc0b40a73b6&displaylang=en

Ah yep, thought I had that wrong. Thanks Ryan.

Off Topic:

I understand the “compatability” bit, but “mjode”? Hmm, was it invented by some Nordic person? :lol: