1
Mediaashley有一個3D css按鈕,使用:之前和之後:用鼠標點擊看起來很酷,但我需要一個具有相同效果的觸摸屏按鈕,而且這個按鈕似乎並不像那樣工作。屏幕按下不會像鼠標點擊那樣提供按鈕按下動畫。是否有一個簡單的調整,將使它做到這一點?謝謝!如何製作觸摸屏按鈕?
HTML
<p>Click to activate.</p>
<p> </p>
<p>
<button class="facebook"></button>
<button class="twitter"></button>
<button class="in"></button>
<button class="vimeo"></button>
</p>
CSS
@font-face {
font-family: 'socialfont';
src: url('http://mediaashley.com/MyFont.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
body {
background: #ddd;
width: 100%;
margin: 70px;
}
button {
width:100px;
height:100px;
display:inline-block;
font-family:Arial, "Helvetica", sans-serif;
font-size:16px;
font-weight:bold;
color:#fff;
text-decoration:none;
text-transform:uppercase;
text-align:center;
text-shadow:1px 1px 0px #07526e;
padding-top:6px;
margin-left:auto;
margin-right:auto;
left:30px;
position:relative;
cursor:pointer;
border: none;
background: #109bce;
background-image: linear-gradient(bottom, rgb(14,137,182) 0%, rgb(22,179,236) 100%);
border-radius: 5px;
box-shadow: inset 0px 1px 0px #2ab7ec, 0px 5px 0px 0px #07526e, 0px 10px 5px #999;
}
button:active {
top:3px;
box-shadow: inset 0px 1px 0px #2ab7ec, 0px 2px 0px 0px #07526e, 0px 5px 3px #999;
}
button:before {
font-family: 'socialfont';
font-size: 50px;
line-height: 1em;
font-weight: normal;
color: #fff;
content:"\F020";
width:85px;
height:90px;
display:block;
position:absolute;
padding-top:10px;
top:10px;
text-shadow: 1px 1px 2px #07526e;
}
button:active:before {
top: 7px;
font-size: 50px;
text-shadow: 0px 3px 0px #07526e, 0px 5px 1px #07526e/*, 3px 0px 1px #07526e, 3px 3px 1px #07526e,
-2px 0px 1px #68cff2*/;
}
.twitter:before {
content:"\F021";
}
.in:before {
content:"\F022";
}
.vimeo:before{
content:"\F024";
}
http://codepen.io/mediaashley/pen/kLbGf
改爲使用':focus'。 –