一款利用純css3實(shí)現(xiàn)的360度翻轉(zhuǎn)按鈕的實(shí)例教程

今天要給大家分享的是由css3實(shí)現(xiàn)的翻轉(zhuǎn)360動(dòng)畫按鈕。之前已為大家分享了好幾款css3按鈕,大家可以點(diǎn)擊鏈接進(jìn)去找一找適合自己的。哈哈。下面先為大家上效果圖:
下面是實(shí)現(xiàn)的代碼。
html代碼:
- <ul class="flatflipbuttons">
- <li><a href="http://chabaoo.cn" title="Search"><span class="icon-search"></span>
- </a><b>Search</b></li>
- <li><a href="http://chabaoo.cn"><span class="icon-gears"></span></a><b>Gears</b></li>
- <li><a href="http://chabaoo.cn"><span class="icon-rss"></span></a><b>RSS</b></li>
- <li><a href="http://chabaoo.cn"><span class="icon-twitter"></span></a><b>Twitter</b></li>
- <li><a href="http://chabaoo.cn"><span class="icon-rocket"></span></a><b>Rocket</b></li>
- </ul>
- <br />
- <br />
- <ul class="flatflipbuttons second">
- <li><a href="http://chabaoo.cn"><span>
- <img src="imgs/rss-heart.png" /></span></a></li>
- <li><a href="http://chabaoo.cn"><span>
- <img src="imgs/twitter-heart.png" /></span></a></li>
- <li><a href="http://chabaoo.cn"><span>
- <img src="imgs/facebook-heart.png" /></span></a></li>
- <li><a href="http://chabaoo.cn"><span>
- <img src="imgs/google-heart.png" /></span></a></li>
- <li><a href="http://chabaoo.cn"><span>
- <img src="imgs/stumble-heart.png" /></span></a></li>
- </ul>
css代碼:
- 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;
- }
以上就是利用css3實(shí)現(xiàn)的翻轉(zhuǎn)360動(dòng)畫按鈕的代碼教程,謝謝閱讀,希望能幫到大家,請(qǐng)繼續(xù)關(guān)注腳本之家,我們會(huì)努力分享更多優(yōu)秀的文章。
相關(guān)文章
利用純css實(shí)現(xiàn)圖片翻轉(zhuǎn)的效果
這篇文章給大家分享的是利用純css實(shí)現(xiàn)圖片翻轉(zhuǎn)效果,對(duì)大家的學(xué)習(xí)使用CSS具有一定的參考借鑒價(jià)值,有需要的朋友們可以參考借鑒。2016-10-09一款基于css3麻將篩子3D翻轉(zhuǎn)特效的實(shí)例教程
這篇文章主要為大家介紹了一款基于css3麻將篩子3D翻轉(zhuǎn)特效的實(shí)例教程,css3使我們能夠跳出2d空間,實(shí)現(xiàn)3維空間的動(dòng)畫效果,這里給出一個(gè)自動(dòng)翻轉(zhuǎn)的3d色子動(dòng)畫效果制作過程2014-12-31css3實(shí)現(xiàn)3D色子翻轉(zhuǎn)特效
這篇文章主要介紹了css3實(shí)現(xiàn)3D色子翻轉(zhuǎn)特效的制作過程及示例代碼,非常的不錯(cuò),效果也非常棒,這里推薦給大家。2014-12-23CSS濾鏡實(shí)現(xiàn)的顏色漸變翻轉(zhuǎn)效果
這篇文章主要為大家介紹了利用CSS中的濾鏡效果實(shí)現(xiàn)漸變翻轉(zhuǎn)效果的代碼,不會(huì)的朋友可以和腳本之家的小編一起學(xué)習(xí)一下,以后想要實(shí)現(xiàn)漸變翻轉(zhuǎn)效果就不難啦2014-10-09純CSS實(shí)現(xiàn)菜單、導(dǎo)航欄的3D翻轉(zhuǎn)動(dòng)畫效果
隨著瀏覽器技術(shù)的進(jìn)步,CSS動(dòng)畫技術(shù)已經(jīng)不是只那些簡(jiǎn)單的淡入淡出效果或幻燈片效果,它們能做很多更強(qiáng)大的事情2014-04-23css控制列表與導(dǎo)航的制作(水平導(dǎo)航條、垂直翻轉(zhuǎn)的列表、垂直導(dǎo)航欄、內(nèi)
這篇文章主要介紹了css控制列表與導(dǎo)航的制作,包括水平導(dǎo)航條、垂直翻轉(zhuǎn)的列表、垂直導(dǎo)航欄、內(nèi)聯(lián)列表、列表樣式等制作方法,需要的朋友可以參考下2014-04-15css3的圖形3d翻轉(zhuǎn)效果應(yīng)用示例
這篇文章主要介紹了css3 的圖形3d翻轉(zhuǎn)效果應(yīng)用,需要的朋友可以參考下2014-04-08CSS圖片翻轉(zhuǎn)動(dòng)畫技術(shù)詳解(IE也實(shí)現(xiàn)了)
因?yàn)椴粩嘤腥藛栁?,現(xiàn)在我補(bǔ)充一下:IE是支持這種技術(shù)的!盡管會(huì)很麻煩。需要做的是旋轉(zhuǎn)front和back元素,而不是旋轉(zhuǎn)整個(gè)容器元素。如果你使用的是最新版的IE,可以忽略這2014-04-03- css 2.0還是沒有翻轉(zhuǎn)的,3.0里面有rotate屬性,這個(gè)可以把元素進(jìn)行任意角度旋轉(zhuǎn),灰常強(qiáng)大,下面有個(gè)不錯(cuò)的示例,大家可以參考下2014-02-27
CSS Cookbook 創(chuàng)建文字導(dǎo)航菜單和翻轉(zhuǎn)特效
CSS Cookbook例子 創(chuàng)建文字導(dǎo)航菜單和翻轉(zhuǎn)特效2009-12-15