CSS3实现图片放大旋转

2023-01-31 01:01:34 图片 放大 旋转

知识点:

    css3动画

    transition


   

 
@-WEBkit-keyframes rotation{
from {-webkit-transfORM: rotate(0deg);}
to {-webkit-transform: rotate(360deg);}
}

效果:

wKiom1YCHS_z-xTYAATheSQ04Eg944.jpg

源码

-----------------------

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>图片过渡缩放</title>
<style>

*{margin: 0;padding: 0;}

.img{margin-left: 25px;margin-top: 50px;margin-right: 25px;
    transition: all 2s ease;
}
.img:hover{
z-index: 10;
border: 1px dashed #ff0000;
-webkit-transform: rotateY(360deg);
transform: scale(1.51,1.51) rotate(360deg);
}
.ta_c{text-align: center;
width: 99%;
}

@-webkit-keyframes rotation{
from {-webkit-transform: rotate(0deg);}
to {-webkit-transform: rotate(360deg);}
}
</style>
</head>
<body>
<div class="ta_c">
<img  src="img/1.jpg" width="25%" class="img" />
<img  src="img/2.jpg" width="25%" class="img" />
<img  src="img/3.jpg" width="25%" class="img" />
<img  src="img/4.png" width="25%" class="img" />
<img  src="img/5.jpg" width="25%" class="img" />
<img  src="img/6.jpg" width="25%" class="img" />
</div>
</body>
</html>

wKioL1YCHYyzfdDXAAJJ_Rdv2Bc883.jpg

wKiom1YfEJix6Yl3AAGfZLm3Ar4634.jpg

相关文章