Floating Cards 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>Floating Cards 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; transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out; } .image-container:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2); } .image-container img { width: 100%; height: 100%; object-fit: cover; border-radius: 20px; } .image-container .info { position: absolute; bottom: 0; left: 0; width: 100%; /* padding: 20px; */ background: rgba(0, 0, 0, 0.7); color: white; text-align: center; border-bottom-left-radius: 20px; border-bottom-right-radius: 20px; transition: transform 0.3s ease-in-out; } .image-container:hover .info { transform: translateY(0); } </style> </head> <body> <div class="image-container"> <img src="https://via.placeholder.com/300x400" alt="Sample Image"> <div class="info"> <h3>Elegant Image</h3> <p>Floating card effect</p> </div> </div> </body> </html>