3D Hover Effects

3D Hover Effects code:

1.index.html:

<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>3D Hover Effects</title> <link rel="stylesheet" href="style.css"> </head> <body> <div class="center"> <div class="box"></div> </div> </body> </html>

2.style.css:

body { margin: 0; padding: 0; background: yellow; } .center { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); perspective: 1000px; } .box { width: 300px; height: 400px; background: white url(logo.png) no-repeat; background-size: 80%; background-position: 30px; transform: rotateX(70deg); transform-style: preserve-3d; transition: 0.5s; } .box::before { content: ''; width: 100%; height: 50px; position: absolute; bottom: 0; background: whitesmoke; transform-origin: bottom; transform: rotateX(90deg); } .box:hover { transform: rotateX(25deg); }

Оставьте комментарий

Ваш адрес email не будет опубликован.