1、我們先設定兩個盒子大小,顏色等等,然后定位重疊在一起,最后再進行影片設定
例子如下:
<style> .box { height: 300px; width: 300px; position: relative; } .zh, .fan { height: 300px; width: 300px; line-height: 300px; font-size: 30px; text-align: center; color: blue; transition: all 2s; backface-visibility: hidden; /* 背面不可見 */ position: absolute; top: 0; left: 0; } .zh { background-color: aqua; } .fan { background-color: aquamarine; transform: rotateY(-180deg) rotateZ(-180deg); } .box:hover .zh { transform: rotateY(180deg) rotateZ(180deg) } .box:hover .fan { transform: rotateY(0) rotateZ(0); } </style> </head> <body> <div > <div >正面</div> <div >反面</div> </div> </body>
2、效果如下:

---恢復內容結束---
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/120024.html
標籤:Html/Css
