2012-03-28 17 views
2

在安卓網頁瀏覽器(我在Android 2.3上看到這個)時,當一個Html輸入如收音機或複選框被觸摸時,會顯示一個簡短的橙色高亮顯示(請參閱附圖)。我在桌面版Chrome或其他瀏覽器上看不到相同的亮點。如何控制Android網頁瀏覽器中html輸入控件的橙色高亮?

無論如何我可以控制這個亮點嗎?我可以通過CSS或Javascript更改它嗎?

enter image description here

回答

2

您可以使用0阿爾法設置-webkit抽頭高亮顏色屬性的RGBA值來禁用了這一切。

以下是您可以試用的快速測試頁面。我剛剛使用Android 4.0.3進行了測試,但它來自我在2.3.3中做過的一些早期工作。

希望這會有所幫助!

<!DOCTYPE html> 
<html lang="en"> 
    <head> 
     <meta http-equiv="Content-Type" content="text/html" charset="utf-8"> 
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1"> 
     <title>Android Test Select</title> 
     <base href="" /> 
     <style> 
      .no-hi { 
       -webkit-tap-highlight-color: rgba(255, 255, 255, 0); 
      } 
     </style> 
    </head> 
    <body> 
     <form> 
      <input type="radio" name="highlight" value="these" /> These<br /> 
      <input type="radio" name="highlight" value="should" /> Should<br /> 
      <input type="radio" name="highlight" value="highlight" /> Highlight 
      <hr/> 
      <input type="radio" name="no-highlight" value="these" class="no-hi" /> These<br /> 
      <input type="radio" name="no-highlight" value="should" class="no-hi" /> Should<br /> 
      <input type="radio" name="no-highlight" value="not" class="no-hi" /> Not 
     </form> 
    </body> 
</html> 
0

也許?

input { outline: none; } 

或可能更好的焦點

input:focus { outline: none; } 
相關問題