我使用了一个简单的 CSS 视差效果 example它适用于除 IE7 + 8 以外的所有浏览器。是否有变通办法或者只是不支持?
<h1>My Page</h1>
<h2>Flowers, Flowers, Flowers </h2>
<div id="slide4" class="slide" data-stellar-background-ratio="0" data-slide="4"> </div>
<div id="slide2" class="slide" data-stellar-background-ratio="0.5" data-slide="2"> </div>
<h2>Some text goes here</h2>
<h2>Some text goes here</h2>
<h2>Some text goes here</h2>
<h2>Some text goes here</h2>
<h2>Some text goes here</h2>
#slide4 {background-image: url("http://ibmsmartercommerce.sourceforge.net/wp-content/uploads/2012/09/Roses_Bunch_Of_Flowers.jpeg");
background-size: contain;
float: left;
margin-top:20px;
height: 450px;}
.slide {background-attachment: fixed;
height: 100%;
position: inherit;
width: 100%;}
最佳答案
背景尺寸不适用于 IE8:http://caniuse.com/#feat=background-img-opts
如果您尝试使用背景大小:封面,请查看这篇文章:http://css-tricks.com/perfect-full-page-background-image/
你也可以在 ie 8 中使用这个 polyfill 支持背景尺寸
关于html - IE7 不支持视差 CSS 效果?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20000086/