Card
Preview
Edit
Download
Run
Download Options
HTML File
Download as .html file
CSS File
Download as .css file
JavaScript File
Download as .js file
Combined HTML
All code in one HTML file
Project ZIP
All files in a ZIP archive
Cancel
HTML
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <title>Beautiful Card</title> <link rel="stylesheet" href="style.css" /> </head> <body> <div class="card-container"> <div class="card" id="card"> <img src="https://images.unsplash.com/photo-1516559828984-fb3b99548b21?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=800&q=80" alt="Card Image" /> <div class="card-content"> <h2>Explore Nature</h2> <p>Discover the untouched beauty of nature with stunning landscapes and refreshing vibes.</p> <button id="learnMore">Learn More</button> </div> </div> </div> <script src="script.js"></script> </body> </html>
CSS
* { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: 'Segoe UI', sans-serif; background: linear-gradient(135deg, #1e3a8a, #f43f5e); min-height: 100vh; display: flex; justify-content: center; align-items: center; padding: 20px; } .card-container { width: 100%; max-width: 350px; } .card { background: rgba(255, 255, 255, 0.08); backdrop-filter: blur(12px); border-radius: 20px; overflow: hidden; box-shadow: 0 15px 30px rgba(0,0,0,0.3); transition: transform 0.3s ease, box-shadow 0.3s ease; cursor: pointer; } .card:hover { transform: translateY(-10px); box-shadow: 0 25px 50px rgba(255,255,255,0.2); } .card img { width: 100%; height: auto; display: block; } .card-content { padding: 20px; color: #fff; } .card-content h2 { font-size: 1.5rem; margin-bottom: 10px; } .card-content p { font-size: 0.95rem; margin-bottom: 20px; color: #e0e0e0; } button { background-color: #6366f1; border: none; padding: 12px 18px; color: white; font-size: 14px; font-weight: bold; border-radius: 10px; transition: background 0.3s ease; } button:hover { background-color: #4f46e5; }
JavaScript
const card = document.getElementById("card"); const button = document.getElementById("learnMore"); button.addEventListener("click", () => { alert("Thank you for exploring! More features coming soon."); });
Output Preview
Desktop
Mobile
Fullscreen