1、卡牌翻转
<!--卡牌反转--><div class="demo1"> ???<div class="box"> ???????<div class="negative"></div> ???????<div class="positive"></div> ???</div></div>
.demo1{width: 200px;height: 300px;margin: 100px auto;} ???????.demo1 .box{width:100%;height: 100%;position: relative;transform-style: preserve-3d;transition: transform 1s;cursor: pointer; animation:fanzhuan 2s infinite linear ; ?} ???????.demo1 .positive{width: 100%;height: 100%;position: absolute;background:url("image/positive.png") 0 0 no-repeat;background-size: 100% 100%;} ???????.demo1 .negative{width: 100%;height: 100%;position: absolute;background:url("image/negative.jpg") 0 0 no-repeat;background-size: 100% 100%;transform:rotateY(180deg);} ???????.demo1 .box:hover{ transform:rotateY(180deg); } ???????@keyframes fanzhuan{ ???????????0%{ transform:rotateY(0deg); ?} ???????????100%{ ?transform:rotateY(360deg); ?} ???????}
效果图
css3
原文地址:https://www.cnblogs.com/fanmiaolan/p/9872268.html