gpt4 book ai didi

css - 在 IE9 中使用 CSS3 PIE 的线性渐变不起作用,IE8 可以

转载 作者:技术小花猫 更新时间:2023-10-29 11:07:50 24 4
gpt4 key购买 nike

我已决定在我的网站中完全放弃对 IE6 和 IE7 的支持,将其用户重定向到纯文本警告页面。但是我仍然支持 IE8 和 IE9。

我正在使用 CSS3 PIE 实现这一目标, 和 border-radius 在两者中都有效 (IE8/9), box-shadow 在两者中都有效, 但是我也依赖于线性渐变。我使用了大量标签来实现这一点:

background: #E6E6E6; /* fallback */
background: -webkit-gradient(linear, 0 0, 0 bottom, from(#E6E6E6), to(#B3BCC7)); /* old webkit */
background: -webkit-linear-gradient(#E6E6E6, #B3BCC7); /* new webkit */
background: -moz-linear-gradient(#E6E6E6, #B3BCC7); /* firefox */
background: -ms-linear-gradient(#E6E6E6, #B3BCC7); /* meant to be IE... */
background: filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#E6E6E6', endColorstr='#B3BCC7'); /* also meant to be IE... */
background: -o-linear-gradient(#E6E6E6, #B3BCC7); /* opera */
background: linear-gradient(#E6E6E6, #B3BCC7); /* W3C standard */
-pie-background: linear-gradient(#E6E6E6, #B3BCC7); /* PIE */

behavior: url(/PIE.htc); /* load PIE.htc */

linear-gradient 在 IE8 中有效,但奇怪的是在 IE9 中无效。我已经尝试过我找到的所有解决方案,但它们都没有用。 IE8 只显示回退:背景:#E6E6E6; - 不是渐变。

我不认为服务器有任何问题或类似的问题,因为其他属性 - border-radiusbox-shadow - 与 PIE 一起工作但是并非没有。

我的所有属性都可以在我支持的所有浏览器中使用——只是 IE9 不行 :(

有什么想法吗?
谢谢

最佳答案

好的,这是我的解决方法。它当然不漂亮,但它确实有效。

<style type="text/css">
body{
background: #E6E6E6;
background: -webkit-gradient(linear, 0 0, 0 bottom, from(#E6E6E6), to(#B3BCC7));
background: -webkit-linear-gradient(#E6E6E6, #B3BCC7);
background: -moz-linear-gradient(#E6E6E6, #B3BCC7);
background: -ms-linear-gradient(#E6E6E6, #B3BCC7);
background: -o-linear-gradient(#E6E6E6, #B3BCC7);
background: linear-gradient(#E6E6E6, #B3BCC7);
-pie-background: linear-gradient(#E6E6E6, #B3BCC7);

behavior: url(/PIE.htc);
}
</style>

<!--[if IE 9]><style>body{ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#E6E6E6', endColorstr='#B3BCC7'); behavior: url(/ie9-gradient-fix.htc); } </style><![endif]-->

编辑:如果有人需要它们,可以在 http://www.css3pie.com 找到 PIE.htc ie9-gradient-fix.htc 位于 http://abouthalf.com/examples/ie9roundedbackgrounds/htc.zip .我无法让 ie9-gradient-fix.htc 工作,除非它在根目录中,PIE.htc 在我的/resources/目录中工作。

关于css - 在 IE9 中使用 CSS3 PIE 的线性渐变不起作用,IE8 可以,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10457519/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com