Hexagon Hover 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>Hexagon Hover Image</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"> <style> body { display: flex; justify-content: center; align-items: center; height: 100vh; background-color: #e0f7fa; font-family: Arial, sans-serif; margin: 0; } .image-container-hexagon { position: relative; width: 320px; height: 320px; clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%); overflow: hidden; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); } .image-container-hexagon img { width: 100%; height: 100%; object-fit: cover; } .image-container-hexagon::before { content: '\f6fc'; font-family: 'Font Awesome 5 Free'; font-weight: 900; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 48px; color: rgba(255, 255, 255, 0.8); opacity: 0; transition: opacity 0.5s ease-in-out; } .image-container-hexagon:hover::before { opacity: 1; } </style> </head> <body> <div class="image-container-hexagon"> <img src="placeholder.png" alt="Random Image"> </div> </body> </html>