I am currently working on a private framework to mimic the iOS UI in CSS 3 and HTML 5. I have created most of the widgets, including the numerous coloured gradient buttons, but I am having difficulty adding in the blue gradient a button is clicked.
I have tried the following examples: button:focus, button:active, button:hover but nothing seems to work. All I am presented with is the default grey box when clicking the button in Mobile WebKit. I wonder if anyone can point me in the right direction.
Essentially, I want to do this:
div.inner button:active {
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(173,182,211,1)), color-stop(1%,rgba(143,155,205,1)), color-stop(50%,rgba(48,74,184,1)), color-stop(51%,rgba(22,49,164,1)), color-stop(100%,rgba(41,89,165,1)));
background: -webkit-linear-gradient(top, rgba(173,182,211,1) 0%,rgba(143,155,205,1) 1%,rgba(48,74,184,1) 50%,rgba(22,49,164,1) 51%,rgba(41,89,165,1) 100%);
color: #fff;
text-shadow: 0 -1px 1px rgba(0,0,0,0.8);
outline: none;
-webkit-appearance: none;
}
Hope that makes sense! I even tried adding the class to the button when it was ‘clicked’ using jQuery but again nothing happens. I suppose my question is, what is the correct pseudo-class called when a user taps an element in Mobile WebKit?
This works for us…