IE后台固定调整大小以覆盖浏览器窗口

时间:2013-01-22 10:38:59

标签: html css3 gradient

下面的代码适用于firefox,chrome等,但不适用于Internet Explorer。即使文本不多,如何使背景覆盖浏览器窗口。

body {
background: -ms-linear-gradient(top, #e5e5e5 0%, #c0bfbf 100%) center center fixed; /* IE10 Consumer Preview */
background: -moz-linear-gradient(top, #e5e5e5 0%, #c0bfbf 100%) center center fixed; /* Mozilla Firefox */
background: -o-linear-gradient(top, #e5e5e5 0%, #c0bfbf 100%) center center fixed; /* Opera */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #e5e5e5), color-stop(1, #c0bfbf)) center center fixed; /* Webkit (Safari/Chrome 10) */
background: -webkit-linear-gradient(top, #e5e5e5 0%, #c0bfbf 100%) center center fixed; /* Webkit (Chrome 11+) */
background: linear-gradient(to bottom, #e5e5e5 0%, #c0bfbf 100%) center center fixed; /* W3C Markup, IE10 Release Preview */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#e5e5e5', endColorstr='#c0bfbf',GradientType=0, sizingMethod='scale'); /* IE6-8 */
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#e5e5e5', endColorstr='#c0bfbf',GradientType=0, sizingMethod='scale')"; /* IE6-8 */

color:#393939;
font:12px/18px Arial,sans-serif;
margin:0;
padding:0px;
}

1 个答案:

答案 0 :(得分:0)

当您使用线性渐变标记中的rgb值替换十六进制代码而没有ms-prefix时,它至少在Windows 8上的IE10中工作

以下是我使用的内容:

background: linear-gradient(to bottom, rgb(255,255,0) 0%, rgb(0,255,255) 100%) center center fixed; /* W3C Markup, IE10 Release Preview */

编辑,这是带有实际颜色值的示例:

background: linear-gradient(to bottom, rgb(229,229,229) 0%, rgb(192,191,191) 100%) center center fixed;