Multiple Background Images issues in ie7/ie8

2019-03-03 23:30发布

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??

2条回答
小情绪 Triste *
2楼-- · 2019-03-03 23:52

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)

查看更多
Viruses.
3楼-- · 2019-03-03 23:54

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.

查看更多
登录 后发表回答