IE 9 中使用 CSS3 固定渐变
我希望为窗口的整个长度放置一个 css3 渐变,当窗口滚动时,渐变会随之滚动。我无法让它在 IE9 中运行? 这是我的代码。有人能指出我正确的方向吗?
body
{
font: 100%/1.4 Tahoma, Geneva, sans-serif;
margin: 0;
padding: 0;
color: #000;
background-attachment: fixed !important;
filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#8fc2ed, endColorstr=#ffffff);
background-image: -moz-linear-gradient(center top -90deg, #8fc2ed, #ffffff);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#8fc2ed), to(#ffffff));
}
谢谢
I am looking to put a css3 gradient for the full length of the window, and when the window scrolls, the gradient would scoll with it. I cannot get it to work in IE9?
Here is my code. Could someone point me in the right direction?
body
{
font: 100%/1.4 Tahoma, Geneva, sans-serif;
margin: 0;
padding: 0;
color: #000;
background-attachment: fixed !important;
filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#8fc2ed, endColorstr=#ffffff);
background-image: -moz-linear-gradient(center top -90deg, #8fc2ed, #ffffff);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#8fc2ed), to(#ffffff));
}
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它不起作用,因为过滤器不是 CSS 背景图像,因此
background-attachment
不适用于它。您可以尝试在页面内容后面添加一个带有过滤器的 100% 高度元素,并将其设置为position:fixed
。It doesn't work because the filter is not a CSS background image, so
background-attachment
doesn't apply to it. You could try adding a 100% height element with the filter on it behind your page content and setting that toposition: fixed
.