2012-02-21 52 views

回答

9

添加-webkit-外观:无;

.inputtxt { 
    border:0; 
    background:none; 
    -webkit-appearance: none; 
} 

jsFiddle例如

+3

可能保持下拉图标? – 2012-02-21 20:02:05

+3

你可以用CSS伪造它:http://jsfiddle.net/u8QRS/ – j08691 2012-02-21 20:06:50

+0

+1喜欢你的解决方案。另一个http://jsfiddle.net/PbYFT/227/ – 2012-02-21 20:21:03

1

我不知道这是不是你想要的,但尝试:

-webkit-appearance:none; 
+0

Thanks Yavanosta。顺便说一句'-webkit-appearance:none'将删除下拉图标。 – 2012-02-21 20:00:02

1

你需要使用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%); 
相关问题