| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Document</title>
- <style>
-
- body{
- background-color: #ccc;
- perspective: 1000px;
- perspective-origin: center center;
- }
- .box{
- width: 400px;
- height: 400px;
- border:3px dashed black;
- margin:200px auto;
- transform-style: preserve-3d;
- }
- .box img{
- width: 100%;
- transition: all 1s ease;
- }
- .box img:first-child{
- transform: rotate(45deg);
- }
- .box img:last-child{
- transform: rotate(-45deg);
- }
- .box img:hover{
- transform: rotate(0) translateZ(500px);
- }
- </style>
- </head>
- <body>
- <div class="box">
- <img src="./img/slider1.jpg" alt="img">
- <img src="./img/slider2.jpg" alt="img">
- </div>
- </body>
- </html>
|