您好,登錄后才能下訂單哦!
這篇文章主要介紹“如何利用純css3實(shí)現(xiàn)360度翻轉(zhuǎn)的按鈕”,在日常操作中,相信很多人在如何利用純css3實(shí)現(xiàn)360度翻轉(zhuǎn)的按鈕問(wèn)題上存在疑惑,小編查閱了各式資料,整理出簡(jiǎn)單好用的操作方法,希望對(duì)大家解答”如何利用純css3實(shí)現(xiàn)360度翻轉(zhuǎn)的按鈕”的疑惑有所幫助!接下來(lái),請(qǐng)跟著小編一起來(lái)學(xué)習(xí)吧!
今天要給大家分享的是由css3實(shí)現(xiàn)的翻轉(zhuǎn)360動(dòng)畫按鈕。之前已為大家分享了好幾款css3按鈕,大家可以點(diǎn)擊鏈接進(jìn)去找一找適合自己的。哈哈。下面先為大家上效果圖:
下面是實(shí)現(xiàn)的代碼。
html代碼:
XML/HTML Code復(fù)制內(nèi)容到剪貼板
<ul class="flatflipbuttons">
<li><a href="http://www.kemok4.com" title="Search"><span class="icon-search"></span>
</a><b>Search</b></li>
<li><a href="http://www.kemok4.com"><span class="icon-gears"></span></a><b>Gears</b></li>
<li><a href="http://www.kemok4.com"><span class="icon-rss"></span></a><b>RSS</b></li>
<li><a href="http://www.kemok4.com"><span class="icon-twitter"></span></a><b>Twitter</b></li>
<li><a href="http://www.kemok4.com"><span class="icon-rocket"></span></a><b>Rocket</b></li>
</ul>
<br />
<br />
<ul class="flatflipbuttons second">
<li><a href="http://www.kemok4.com"><span>
<img src="imgs/rss-heart.png" /></span></a></li>
<li><a href="http://www.kemok4.com"><span>
<img src="imgs/twitter-heart.png" /></span></a></li>
<li><a href="http://www.kemok4.com"><span>
<img src="imgs/facebook-heart.png" /></span></a></li>
<li><a href="http://www.kemok4.com"><span>
<img src="imgs/google-heart.png" /></span></a></li>
<li><a href="http://www.kemok4.com"><span>
<img src="imgs/stumble-heart.png" /></span></a></li>
</ul>
css代碼:
CSS Code復(fù)制內(nèi)容到剪貼板
ul.flatflipbuttons
{
margin: 0;
padding: 0;
list-style: none;
-webkit-perspective: 10000px; /* larger the value, the less pronounced the 3D effect */
-moz-perspective: 10000px;
perspective: 10000px;
}
ul.flatflipbuttons li
{
margin: 0;
display: inline-block;
width: 100px; /* dimensions of buttons. */
height: 100px;
margin-right: 15px; /* spacing between buttons */
background: white;
text-transform: uppercase;
text-align: center;
}
ul.flatflipbuttons li a
{
display: table;
font: bold 36px Arial; /* font size, pertains to icon fonts specifically */
width: 100%;
height: 100%;
margin-bottom: 4px;
color: black;
background: #3B9DD5;
text-decoration: none;
outline: none;
-webkit-transition: all 300ms ease-out; /* CSS3 transition. Last value is pause before transition play */
-moz-transition: all 300ms ease-out;
transition: all 300ms ease-out;
}
ul.flatflipbuttons li:nth-of-type(1) a
{
color: white;
background: #3B9DD5;
}
ul.flatflipbuttons li:nth-of-type(2) a
{
background: #A1CD3A;
}
ul.flatflipbuttons li:nth-of-type(3) a
{
background: #80C5EC;
}
ul.flatflipbuttons li:nth-of-type(4) a
{
color: white;
background: #635746;
}
ul.flatflipbuttons li:nth-of-type(5) a
{
background: #F2C96D;
}
ul.flatflipbuttons li a span
{
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
display: table-cell;
vertical-align: middle;
width: 100%;
height: 100%;
-webkit-transition: all 300ms ease-out; /* CSS3 transition. */
-moz-transition: all 300ms ease-out;
transition: all 300ms ease-out;
}
ul.flatflipbuttons li b
{
/* CSS for text beneath button */
display: block;
position: relative;
width: 100%;
opacity: 0;
-webkit-transition: all 300ms ease-out 0.2s; /* CSS3 transition. 0.2s delay */
-moz-transition: all 300ms ease-out 0.2s;
transition: all 300ms ease-out 0.2s;
}
ul.flatflipbuttons li a img
{
/* CSS for image if defined inside button */
border-width: 0;
vertical-align: middle;
}
ul.flatflipbuttons li:hover a
{
-webkit-transform: rotateY(180deg); /* flip horizontally 180deg*/
-moz-transform: rotateY(180deg);
transform: rotateY(180deg);
background: #c1e4ec; /* bgcolor of button onMouseover*/
-webkit-transition-delay: 0.2s;
-moz-transition-delay: 0.2s;
transition-delay: 0.2s;
}
ul.flatflipbuttons li:hover a span
{
color: black; /* color of icon font onMouseover */
-webkit-transform: rotateY(180deg);
-moz-transform: rotateY(180deg); /* flip horizontally 180deg*/
transform: rotateY(180deg);
-webkit-transition-delay: 0.2s;
-moz-transition-delay: 0.2s;
transition-delay: 0.2s;
}
ul.flatflipbuttons li:hover b
{
opacity: 1;
}
/* CSS for 2nd menu below specifically */
ul.second li a
{
background: #eee !important;
}
ul.second li a:hover
{
background: #ddd !important;
}
到此,關(guān)于“如何利用純css3實(shí)現(xiàn)360度翻轉(zhuǎn)的按鈕”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實(shí)踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識(shí),請(qǐng)繼續(xù)關(guān)注億速云網(wǎng)站,小編會(huì)繼續(xù)努力為大家?guī)?lái)更多實(shí)用的文章!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。