布局:
<body>
<section class="photo">
<div class="pic pic1"></div>
<div class="pic pic2"></div>
</section>
</body>
样式:
<style>
.photo{
width: 600px;
margin: 50px auto 0;
display: flex;
justify-content: space-between;
align-items: center;
}
.photo .pic{
width: 220px;
height: 220px;
background-color: aqua;
border-radius: 50%;
background-repeat: no-repeat;
background-position: center center;
background-size: 100%;
border-radius: 110px;
transition: transform 0.5s ease-out;
}
.photo .pic:hover{
/* 变形 rotateZ ,X ,Y Z轴,X轴,Y轴,三种旋转方向,角度可取负
度数也可写为turn. 1turn表示一圈
*/
transform: rotateZ(360deg);
}
.pic1{
background-image: url(./1.jpg);
}
.pic2{
background-image: url(./2.jpg);
}
</style>
查看效果: