<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
.box {
width: 400px;
height: 400px;
border: 1px dashed #f00;
perspective: 500px;
}
.box img {
transition: 2s;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
/* 背面是否可见 */
}
.box:hover img {
transform: rotateX(180deg)
}
.box1 {
position: relative;
width: 291px;
height: 251px;
box-shadow: 0 0 0 2px #200;
perspective: 300px;
}
.box1 img {
position: absolute;
left: 0;
top: 0;
transition: 1s;
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
backface-visibility: hidden;
}
.box1 img:nth-of-type(1) {
transform: rotateX(0deg);
}
.box1 img:nth-of-type(2) {
transform: rotateX(-180deg);
}
.box1:hover img:nth-of-type(1) {
transform: rotateX(180deg);
}
.box1:hover img:nth-of-type(2) {
transform: rotateX(0deg);
}
</style>
</head>
<body>
<div class="box">
<img src="./img/01.jpg" alt="" width="400">
</div>
<div class="box1">
<img src="./img/03.jpg" alt="">
<img src="./img/14.jpg" alt="">
</div>
</body>
</html>