简体   繁体   中英

iOS html5 css3 button click style

I write my application on HTML5/CSS3/JavaScript. For my button I create style (all work fine in browser), but when I start my application on iPad my active effect override standart iOS click effect. How I can override this standart effect?

My style :

<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' );
}

My Button:

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

The answer to your problem I believe is very simple.

Add this following CSS code to your button or body tag (to affect the entire document).

body { -webkit-appearance: none; }

This will remove default styles for buttons that iOS places onto certain UI elements.

Hope that helps.

我有同样的问题使用按钮标签,它似乎覆盖。

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM