Multiple Background Images issues in ie7/ie8

こ雲淡風輕ζ 提交于 2019-12-02 19:16:49

问题


I am trying to solve a bug in ie7/ie8 for multiple background images...

I know that in originally it doesn't support in ie's but i have googled some interesting stuff on web, for example, Cross-Browser Multiple Background

Basically it is of two images background but i want to have 3 images with the defined position and size of the images via css... Fiddle code is not working in ie7/ie8...

http://jsfiddle.net/CsKhy/4/

Can anyone help??


回答1:


Use nested divs for a crossbrowser-compatible solution.

Demo:
http://jsfiddle.net/CsKhy/5/

Note: background-size is not compatible in IE8 or lower, so maybe it's better using images instead of backgroundimages.




回答2:


I use

<style>
  .bgImage{width:100%;}
</style>

Right after the body tag and before any other code insert this

<img src="yourimage" class="bgImage"/>

Not ideal solution but is compatible and works, I have used it many times. (make sure your image is a large image to begin with otherwise it will distort on larger screens)



来源:https://stackoverflow.com/questions/11114533/multiple-background-images-issues-in-ie7-ie8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!