Toggle navigation
☰
Home
HTML
CSS
Scripting
Database
<!DOCTYPE html> <title>My Example</title> <!-- Place the following CSS in your <head> or stylesheet --> <style> /* This is an optional body style to provide a background for the page */ body { background-color: #f3f4f6; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif; } /* === Grid Container for the Cards === */ .cards-grid-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; padding: 1.5rem; } /* === Hover to Reveal Card Styles === */ .reveal-card { --reveal-radius: 12px; --reveal-height: 380px; --reveal-shadow: 0 4px 10px rgba(0,0,0,0.08); position: relative; height: var(--reveal-height); border-radius: var(--reveal-radius); overflow: hidden; box-shadow: var(--reveal-shadow); color: #ffffff; text-decoration: none; display: block; } /* Background image */ .reveal-card-image { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; } .reveal-card:hover .reveal-card-image { transform: scale(1.05); } /* Initially visible content */ .reveal-card-initial-content { position: absolute; bottom: 0; left: 0; right: 0; padding: 1.5rem; background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%); transition: opacity 0.3s ease; } .reveal-card:hover .reveal-card-initial-content { opacity: 0; } .reveal-card-title { font-size: 1.5rem; font-weight: 700; line-height: 1.2; margin: 0; } /* Hidden content that appears on hover */ .reveal-card-hover-content { position: absolute; inset: 0; background-color: rgba(17, 24, 39, 0.9); display: flex; flex-direction: column; justify-content: center; padding: 2rem; opacity: 0; /* Start fully translated down */ transform: translateY(100%); transition: opacity 0.3s ease, transform 0.3s ease; } .reveal-card:hover .reveal-card-hover-content { opacity: 1; /* Animate to final position */ transform: translateY(0); } .reveal-card-description { font-size: 1rem; line-height: 1.6; margin: 0 0 1.25rem; } .reveal-card-link { color: #111827; background-color: #ffffff; padding: 0.6rem 1.25rem; border-radius: 8px; text-decoration: none; font-weight: 500; align-self: flex-start; /* Aligns button to the left */ } </style> <!-- Place the following HTML in your <body> --> <div class="cards-grid-container"> <!-- Card 1 --> <a href="#" class="reveal-card"> <img src="https://placehold.co/640x760/a78bfa/ffffff/png?text=UX+Case+Study" alt="Abstract placeholder image for a UX case study." class="reveal-card-image"> <div class="reveal-card-initial-content"> <h3 class="reveal-card-title">UX Case Study</h3> </div> <div class="reveal-card-hover-content"> <p class="reveal-card-description">A complete overhaul of an e-commerce platform's checkout flow to reduce friction and increase conversion.</p> <span class="reveal-card-link">Read More</span> </div> </a> <!-- Card 2 --> <a href="#" class="reveal-card"> <img src="https://placehold.co/640x760/7dd3fc/ffffff/png?text=Branding+Project" alt="Abstract placeholder image for a branding project." class="reveal-card-image"> <div class="reveal-card-initial-content"> <h3 class="reveal-card-title">Branding Project</h3> </div> <div class="reveal-card-hover-content"> <p class="reveal-card-description">Developing a fresh brand identity for a sustainable coffee startup, including logo, packaging, and digital assets.</p> <span class="reveal-card-link">Read More</span> </div> </a> </div>