Text With Image Backgrounds - 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>Text with Image Backgrounds</title> <style> body { margin: 0; font-family: 'Arial', sans-serif; background-color: #f0f0f5; display: flex; justify-content: center; align-items: center; height: 100vh; } .text-background-container { position: relative; width: 80%; max-width: 800px; height: 300px; margin: 20px auto; overflow: hidden; border-radius: 20px; box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15); transition: transform 0.3s ease; } .text-background-container:hover { transform: scale(1.05); } .text-background-container img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.7) saturate(1.2); transition: filter 0.3s ease; } .text-background-container:hover img { filter: brightness(0.9) saturate(1.5); } .text-content { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: #fff; text-align: center; font-size: 2em; font-weight: bold; line-height: 1.2; text-shadow: 0 3px 10px rgba(0, 0, 0, 0.5); z-index: 2; animation: fadeIn 1s ease-in-out; } .text-content i { margin-right: 10px; } .text-background-container:before { content: "✨"; position: absolute; top: 20px; right: 20px; font-size: 2em; z-index: 1; animation: sparkle 2s infinite; } .text-background-container:after { content: "🚀"; position: absolute; bottom: 20px; left: 20px; font-size: 2em; z-index: 1; animation: rocketFly 3s infinite; } @keyframes fadeIn { 0% { opacity: 0; transform: translate(-50%, -40%); } 100% { opacity: 1; transform: translate(-50%, -50%); } } @keyframes sparkle { 0%, 100% { transform: rotate(0deg) scale(1); } 50% { transform: rotate(20deg) scale(1.2); } } @keyframes rocketFly { 0% { transform: translate(0, 0) rotate(0deg); } 50% { transform: translate(10px, -10px) rotate(-10deg); } 100% { transform: translate(0, 0) rotate(0deg); } } </style> </head> <body> <div class="text-background-container"> <img src="https://via.placeholder.com/800x300.png?text=Your+Background+Image+Here" alt="Background Image"> <div class="text-content"> <i class="fas fa-lightbulb"></i> Innovative Solutions </div> </div> <!-- Font Awesome Icons --> <script src="https://kit.fontawesome.com/a076d05399.js"></script> </body> </html>