2012-03-15 79 views
3

我在HTML5/CSS3/JavaScript上編寫我的應用程序。對於我的按鈕,我創建了樣式(在瀏覽器中工作正常),但是當我在iPad上啓動我的應用程序時,我的主動效果將覆蓋標準的iOS單擊效果。 我如何覆蓋這種標準效果?iOS html5 css3按鈕點擊樣式

我的風格:

<style type="text/css">  
.button { 
display: inline-block; 
width: 150px; 
height: 50px; 
background: #f78d1d; 
background: -webkit-gradient(linear, left top, left bottom, from(#faa51a), to(#f47a20)); 
background: -moz-linear-gradient(top, #faa51a, #f47a20); 
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#faa51a', endColorstr='#f47a20'); 
} 

.button:ACTIVE { 
background: #f47c20; 
background: -webkit-gradient(linear, left top, left bottom, from(#f88e11), to(#f06015)); 
background: -moz-linear-gradient(top, #f88e11, #f06015); 
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f88e11', endColorstr='#f06015'); 
} 

我的按鈕:

<a href="#" class="button"></a> 

回答

0

我有同樣的問題,請使用按鈕標籤,似乎覆蓋。

<button class="button"><a href="#go">Link</a></button> 
4

您的問題的答案我相信很簡單。

將以下CSS代碼添加到您的按鈕或正文標籤(以影響整個文檔)。

body { -webkit-appearance: none; } 

這將刪除iOS放置在特定UI元素上的按鈕的默認樣式。

希望有所幫助。