您好,登錄后才能下訂單哦!
這篇文章主要講解了“css3中如何實(shí)現(xiàn)圖形3d翻轉(zhuǎn)效果”,文中的講解內(nèi)容簡(jiǎn)單清晰,易于學(xué)習(xí)與理解,下面請(qǐng)大家跟著小編的思路慢慢深入,一起來(lái)研究和學(xué)習(xí)“css3中如何實(shí)現(xiàn)圖形3d翻轉(zhuǎn)效果”吧!
代碼如下:
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html" charset="utf-8" /> <title>css3 3d rotate</title> <style type="text/css"> body,div,ul,li{ padding:0; margin:0; } .container ul li { height: 180px; width: 180px; margin-right: 20px; margin-bottom: 20px; display: inline; -webkit-perspective: 1000px; -moz-perspective: 1000px; float: left; } .out_box{ position: relative; height: 180px; width: 180px; -webkit-transform-style: preserve-3d; -moz-transform-style: preserve-3d; -ms-transform-style: preserve-3d; transform-style: preserve-3d; -webkit-transition: 0.5s; -moz-transition: 0.5s; -o-transition: 0.5s; -ms-transition: 0.5s; transition: 0.5s; -webkit-backface-visibility: hidden; -moz-backface-visibility: hidden; backface-visibility: hidden; } .out_box div{ display: block; height: 180px; width: 180px; position: absolute; left: 0; top: 0; background: #060; text-align: center; -webkit-backface-visibility: hidden; -moz-backface-visibility: hidden; backface-visibility: hidden; color:#FFF; line-height:180px; font-size:16px; } .out_box .front_box{ z-index: 2; } .out_box .back_box{ z-index: 1; -webkit-transform: rotateY(180deg); -moz-transform: rotateY(180deg); transform: rotateY(180deg); } .container ul li:hover .out_box{ -webkit-transform: rotateY(180deg); -moz-transform: rotateY(180deg); transform: rotateY(180deg); } .container ul li:hover .back_box{ z-index: 3; } </style> </head> <body> <div class="container"> <ul> <li> <div class="out_box"> <div class="front_box">front</div> <div class="back_box">back</div> </div> </li> <li> <div class="out_box"> <div class="front_box">front2</div> <div class="back_box">back2</div> </div> </li> <li> <div class="out_box"> <div class="front_box">front3</div> <div class="back_box">back3</div> </div> </li> </ul> </div> </body> </html>
感謝各位的閱讀,以上就是“css3中如何實(shí)現(xiàn)圖形3d翻轉(zhuǎn)效果”的內(nèi)容了,經(jīng)過(guò)本文的學(xué)習(xí)后,相信大家對(duì)css3中如何實(shí)現(xiàn)圖形3d翻轉(zhuǎn)效果這一問題有了更深刻的體會(huì),具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是億速云,小編將為大家推送更多相關(guān)知識(shí)點(diǎn)的文章,歡迎關(guān)注!
免責(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)容。