我有一个使用 bootstrap v2 的页面,它在 Firefox 中运行良好,我想在 IE8 中应用相同的 css 颜色样式,但我不知道该怎么做:
.navbar-inverse .navbar-inner {
background-color: #1b1b1b;
background-image: -moz-linear-gradient(top, #fabc75, #fa8a07);
/*
The above works in Firefox, I want to have the same work in IE8 but
don't know which of the below to edit
*/
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#222), to(#111));
background-image: -webkit-linear-gradient(top, #222, #111);
background-image: -o-linear-gradient(top, #222, #111);
background-image: linear-gradient(to bottom, #222, #111);
background-repeat: repeat-x;
border-color: #252525;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff111111', GradientType=0);
}
最佳答案
渐变在 IE8 中不起作用,您可以使用这样的图像:
<!--[if lte IE 8]>
<style type='text/css'>
.navbar-inverse .navbar-inner {
background: url('gradient.jpg') repeat-x;
}
</style>
<![endif]-->
这里有更多技巧:http://browserhacks.com/
关于css - Bootstrap - CSS - 将 Firefox 样式复制到 IE8?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21985867/