效果:
代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
.box1{
height: 200px;
width: 200px;
margin: 40px auto;
perspective: 500px;
}
img{
width: 200px;
height: 200px;
border: 1px solid #000;
border-radius: 50%;
}
.dog{
position: absolute;
top: 0;
left: 0;
transform-origin: 0 0;
transition: transform 1s ease 0s ;
}
.box1:hover img.dog{
transform: rotateY(-180deg);
}
</style>
</head>
<body>
<div class="box1">
<img src="images/cat.jpg" alt="" class="cat">
<img src="images/dog.jpg" alt="" class="dog">
</div>
</body>
</html>
这个还挺好玩的耶.