louisremi / background-size-polyfill

Adds support for background-size "cover" and "contain" to IE8
http://louisremi.github.com/background-size-polyfill/
MIT License
1.26k stars 359 forks source link

broken by certain doctypes? #53

Open alyarb opened 10 years ago

alyarb commented 10 years ago

I must say it took a while of eliminating elements before I found out it was my doctype string causing it.

here's a dump of the home page and you can see how the background image should look in a browser supporting background-size:

http://www.sdc-hosting.com/images/files/nb/site/site.htm

However, in ie8, only a white (null?) background image is displayed (though you can briefly see the original unscaled image if you hammer F5)

In the first link's source, you'll see <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

However, the image will display and scale properly in ie8 if I reduce this to <!DOCTYPE html PUBLIC >

but that will break the positioning of my DIVs, you can see the result here:

http://www.sdc-hosting.com/images/files/nb/site/site2.htm

I am pretty close to just giving up on a background scaler for ie8, but I would really appreciate it if someone considered my case. Thanks a lot!