Rotating Frame Image - MeggiTools
Run
Toggle Theme
Share Link
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Rotating Frame Image</title> <style> body { display: flex; justify-content: center; align-items: center; height: 100vh; background: #e0e0e0; margin: 0; font-family: Arial, sans-serif; } .image-container { position: relative; width: 300px; height: 400px; overflow: hidden; border-radius: 20px; } .frame { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 100%; height: 100%; background: rgba(255, 0, 0, 0.3); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); transition: transform 0.5s ease-in-out; } .image-container:hover .frame { transform: rotate(10deg) scale(1.1); } .image { width: 100%; height: 100%; object-fit: cover; border-radius: 20px; transition: transform 0.5s ease-in-out; } </style> </head> <body> <div class="image-container"> <div class="frame"></div> <img class="image" src="https://via.placeholder.com/300x400" alt="Sample Image"> </div> </body> </html>