css - 背景渐变在 IE10 中渲染不正确

标签 css background internet-explorer-10

#top_container
{  
   padding-bottom: 5px;
   background: #d1d1ff;
   background: -webkit-gradient(linear, left top, left bottom, from(#7db9e8), to(#1e5799));
   background: -moz-linear-gradient(#d1ffff, #d1d1ff);
   background: -o-linear-gradient(#d1ffff, #d1d1ff);
   background: -webkit-linear-gradient(#d1ffff, #d1d1ff);
   filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#d1ffff', endColorstr='#d1d1ff',gradientType=0 );
   background: -ms-linear-gradient(top, #d1ffff 30%, #d1d1ff 100%);
   background:linear-gradient(to bottom, #d1ffff 30%, #d1d1ff 70%);
}

除 IE10 外,渐变显示正确 - 我搜索了其他可能的语法版本,并尝试了 -ms-linear-gradient 和 linear-gradient 的许多不同版本。

还有什么可能导致它不显示。背景 #d1d1ff 正在容器中显示。

最佳答案

jsFiddle使用 Ultimate CSS Gradient Generator 构建.为此,网上有很多工具!添加了一个最小高度,以便它可以在 jsFiddle 上正确显示,如果您复制此代码,请确保将其删除。

CSS:

#top_container {  
    min-height: 200px;
    padding-bottom: 5px;
    background: #d1ffff;
    background: -moz-linear-gradient(top,  #d1ffff 0%, #d1d1ff 100%);
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#d1ffff), color-stop(100%,#d1d1ff));
    background: -webkit-linear-gradient(top,  #d1ffff 0%,#d1d1ff 100%);
    background: -o-linear-gradient(top,  #d1ffff 0%,#d1d1ff 100%);
    background: -ms-linear-gradient(top,  #d1ffff 0%,#d1d1ff 100%);
    background: linear-gradient(to bottom,  #d1ffff 0%,#d1d1ff 100%);
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#d1ffff', endColorstr='#d1d1ff',GradientType=0 );
}

关于css - 背景渐变在 IE10 中渲染不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31985314/

相关文章:

internet-explorer-9 - Border-radius 在 IE9、IE10 和 IE11 中导致奇怪的行为

javascript - "display: none"流畅的动画

css - 在 div 中居中背景图像

vuejs2 - Vuejs Internet Explorer 兼容性问题(版本 10 和 11)

ios - iOS 中的倒数计时器在后台不工作

background - 从扩展后台或弹出窗口发送消息到内容脚本不起作用

javascript - IE 10 和 IE 11 中函数之外的“return”语句

html - 如何制作折叠引导菜单(不是导航栏),其中在桌面 View 上禁用折叠并在移动 View 上启用折叠?

css - 如何将网页添加到现有网页? (HTML5)

javascript - 如何更改导航栏当前页面的颜色