在触摸屏设备上,如何在按下 HTML 按钮后将其返回到非活动状态?悬停和活动伪选择器当前的样式相同:
button.largeButton {
font-size:15px;
padding:0 18px;
height:36px;
background:#fff;
border:none;
border:2px solid #1a1a1a;
box-shadow:0 0 6px rgba(0,0,0,0.18), inset 0 0 6px rgba(0,0,0,0.18);
letter-spacing:1px;
color:#1a1a1a;
border-radius:1px;
-webkit-transition: all 0.09s ease-out;
-moz-transition: all 0.09s ease-out;
-o-transition: all 0.09s ease-out;
transition: all 0.09s ease-out;
}
button.largeButton:hover,
button.largeButton:active {
background:#1a1a1a;
color:#fff;
box-shadow: inset 0 0 9px rgba(255,255,255,0.18);
-webkit-transition: all 0.09s ease-out;
-moz-transition: all 0.09s ease-out;
-o-transition: all 0.09s ease-out;
transition: all 0.09s ease-out;
border-color:#333;
}
仅 CSS 的解决方案更可取,但 JS/jQuery 很好。