2012-02-21 48 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%); 
相關問題