这里的一个例子http://jsfiddle.net/h6PLV/background:none;
如何在Chrome中删除选择选项的白色背景?
谷歌浏览器在选择选项周围有白色。在Firefox中看起来不错。
如何删除Chrome浏览器上的白色?
这里的一个例子http://jsfiddle.net/h6PLV/background:none;
如何在Chrome中删除选择选项的白色背景?
谷歌浏览器在选择选项周围有白色。在Firefox中看起来不错。
如何删除Chrome浏览器上的白色?
我不知道这是不是你想要的,但尝试:
-webkit-appearance:none;
Thanks Yavanosta。顺便说一句'-webkit-appearance:none'将删除下拉图标。 – 2012-02-21 20:00:02
你需要使用jQuery
if($.browser.chrome){
userAgent = userAgent.substring(userAgent.indexOf('chrome/') +7);
userAgent = userAgent.substring(0,userAgent.indexOf('.'));
version = userAgent;
// If it is chrome then jQuery thinks it's safari so we have to tell it it isn't
$.browser.safari = false;
}
那么你可以申请在你的CSS多次更改这些诸如背景来检测浏览器:通过指定,如果没有这是铬或不。
background-color:#ffffff;
background-image:-webkit-gradient(linear, left bottom, left top, color-stop(0, #f4f4f4), color-stop(0.48, #eeeeee), color-stop(0.5, #f6f6f6), color-stop(0.8, #ffffff));
background-image:-webkit-linear-gradient(center bottom, #f4f4f4 0%, #eeeeee 48%, #f6f6f6 50%, #ffffff 80%);
background-image:-moz-linear-gradient(center bottom, #f4f4f4 0%, #eeeeee 48%, #f6f6f6 50%, #ffffff 80%);
background-image:-o-linear-gradient(top, #f4f4f4 0%, #eeeeee 48%, #f6f6f6 50%, #ffffff 80%);
background-image:-ms-linear-gradient(top, #f4f4f4 0%, #eeeeee 48%, #f6f6f6 50%, #ffffff 80%);
background-image:linear-gradient(top, #f4f4f4 0%, #eeeeee 48%, #f6f6f6 50%, #ffffff 80%);
可能保持下拉图标? – 2012-02-21 20:02:05
你可以用CSS伪造它:http://jsfiddle.net/u8QRS/ – j08691 2012-02-21 20:06:50
+1喜欢你的解决方案。另一个http://jsfiddle.net/PbYFT/227/ – 2012-02-21 20:21:03