我正在慢慢删除一些用于透明div的小png文件,并用CSS代码替换它们。CSS透明背景无法在IE7-8中工作
这个CSS代码工作在FF和IE9-10,它在造型文本框帮助(当你点击它,它也改变了背景并增加了一个红色的像素边框):
#searchbars input {
width: 130px;
border: 1px solid #FFF;
padding: 4px 2px 2px 10px;
font-size: .9em;
font-family: Helvetica, Arial, sans-serif;
height: 16px;
/* Fallback for web browsers that doesn't support RGBa */
background: rgb(22, 22, 22) transparent; /* #161616/
/* RGBa with 0.28 opacity */
background: rgba(22, 22, 22, 0.28);
color: #FFF;
}
#searchbars input:active,
#searchbars input:focus {
/* Fallback for web browsers that doesn't support RGBa */
background: rgb(22, 22, 22) transparent; /* #161616/
/* RGBa with 0.75 opacity */
background: rgba(22, 22, 22, 0.75);
border: 1px solid #ff8277;
}
这里的对于IE7条件样式表:
/* For IE 5.5 - 7*/
#searchbars input {
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#47161616, endColorstr=#47161616);
}
#searchbars input:active, #searchbars input:focus {
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#bf161616, endColorstr=#bf161616);
}
IE8条件片:
/* For IE 8*/
#searchbars input {
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#47161616, endColorstr=#47161616)";
}
#searchbars input:active, #searchbars input:focus {
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#bf161616, endColorstr=#bf161616)";
}
我用IE10显影剂工具,并试图使用IE7-8-9引擎渲染页面。
IE9/10 /火狐 - >一切正常
IE8 - >默认背景,当你点击文本框(input:focus
)的背景变化是不可预期的。似乎即使阿尔法十六进制值是正确的,不透明度仍未应用。
IE7 - >默认背景有效。点击文本框(input:focus
)后,背景更改不起作用。 此外,当你点击它的文本框边框没有变红(见原始表单border: 1px solid #ff8277;
属性)
这里有一个演示页:http://www.flapane.com/calcio.php
搜索框是在右上角,右的社交分享按钮。
任何提示?
在此先感谢
这不是一个真正的答案,如果它被低估,我不会感到惊讶,但是您听说过渐进式增强吗? –
这应该已经覆盖了浏览器的99%(根据Google Analytics统计)。 – flapane