您好,登錄后才能下訂單哦!
這篇文章主要講解了“css3實現的動畫按鈕代碼分享”,文中的講解內容簡單清晰,易于學習與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學習“css3實現的動畫按鈕代碼分享”吧!
今天給大家分享一款純css3實現的動畫按鈕。第一排的按鈕當鼠標經過的背景色動畫切換,圖標從右側飛入,第二排的按鈕當鼠標經過的時候邊框動畫切換,圖標右側飛入,效果非常好,一起看下效果圖:
實現的代碼。
html代碼:
XML/HTML Code復制內容到剪貼板
<div class="black">
<a href="#" class="btn"><span>Become A Member</span> <i>→</i> </a><a href="#"
class="btn"><span>Support Us</span> <i>→</i> </a><a href="#" class="btn"><span>
Going Down</span> <i class="down">→</i> </a><a href="#" class="btn"><span>Sign
Up</span> <i class="up">→</i> </a>
</div>
<div class="white">
<a href="#" class="btn"><span>Become A Member</span> <i>→</i> </a><a href="#"
class="btn"><span>Support Us</span> <i>→</i> </a><a href="#" class="btn"><span>
Going Down</span> <i class="down">→</i> </a><a href="#" class="btn"><span>Sign
Up</span> <i class="up">→</i> </a>
</div>
css3代碼:
CSS Code復制內容到剪貼板
body
{
}
h2
{
font-family: "Abril Titling" , Georgia, serif;
color: #f9f9f9;
letter-spacing: 1px;
}
body div
{
padding: 60px 0;
text-align: center;
height: 80px;
margin-top: 0;
}
.black
{
background: #262D28;
}
.white
{
background: #f9f9f9;
}
a
{
display: inline-block;
margin: 10px;
}
.btn
{
position: relative;
width: 160px;
padding: 1.2rem 3rem;
border: 1px solid #0AA944;
font-size: 15px;
text-decoration: none;
color: #f9f9f9;
font-family: "Tablet Gothic" , sans-serif;
text-transform: uppercase;
font-weight: 300;
letter-spacing: 1.5px;
-webkit-transition: all .2s ease-out;
-moz-transition: all .2s ease-out;
-ms-transition: all .2s ease-out;
-o-transition: all .2s ease-out;
transition: all .2s ease-out;
}
.white .btn
{
color: #262D28;
border: 2px solid #0AA944;
}
.btn span
{
position: relative;
top: 2px;
left: 0;
-webkit-transition: all .3s ease-out;
-moz-transition: all .3s ease-out;
-ms-transition: all .3s ease-out;
-o-transition: all .3s ease-out;
transition: all .3s ease-out;
}
.btn i
{
opacity: 0;
position: absolute;
margin-top: -21px;
top: 2.5rem;
left: 120%;
-webkit-transition: all .3s ease-out;
-moz-transition: all .3s ease-out;
-ms-transition: all .3s ease-out;
-o-transition: all .3s ease-out;
transition: all .3s ease-out;
}
.btn:hover
{
background: rgba(255,255,255, .9);
border: 1px solid rgba(0,0,0,1);
}
.white .btn:hover
{
background: rgba(0,0,0, .02);
border: 2px solid rgba(0,0,0,1);
}
.btn:hover span
{
color: #333;
left: -20px;
}
a.btn:hover i
{
opacity: 1;
left: 80%;
color: #333;
-webkit-transform: scale(1.2);
}
a.btn:hover .up
{
-webkit-transform: rotate(270deg);
}
a.btn:hover .down
{
-webkit-transform: rotate(90deg);
}
感謝各位的閱讀,以上就是“css3實現的動畫按鈕代碼分享”的內容了,經過本文的學習后,相信大家對css3實現的動畫按鈕代碼分享這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是億速云,小編將為大家推送更多相關知識點的文章,歡迎關注!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。