css - Bootstrap - CSS - 将 Firefox 样式复制到 IE8?

标签 css twitter-bootstrap

我有一个使用 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/

相关文章:

html - 居中对齐图像

javascript - 如何防止href重定向到外部页面。

css - 通用 twitter bootstrap sticky-footer-with-navbar 示例中的错误?

jquery - Bootstrap 复选框始终返回

jquery - 如何将数据绑定(bind)到 Bootstrap 选择

html - 表格中的背景颜色不显示空单元格

html - 背景大小 : cover is not working to completely fill div with background-image

html - Div 被下面的内容渗透了吗?

jquery - 使用 jQuery TableSorter 按多列对表进行排序

javascript - 使用 jQuery 向下遍历 Bootstrap DOM