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; } /* === Work Sample Card Styles === */ .work-sample-card { --work-radius: 12px; --work-height: 280px; position: relative; /* This is the positioning context */ display: flex; flex-direction: column; justify-content: flex-end; /* Pushes content down */ height: var(--work-height); border-radius: var(--work-radius); overflow: hidden; color: #ffffff; box-shadow: 0 4px 12px rgba(0,0,0,0.15); text-decoration: none; } /* Background image */ .work-sample-image { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; /* Placed at the back of the stacking context */ transition: transform 0.3s ease; } .work-sample-card:hover .work-sample-image { transform: scale(1.05); } /* Content overlay */ .work-sample-content { position: relative; /* Lifts this content above the z-index: 0 image */ z-index: 1; padding: 1.5rem; background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.7) 40%, transparent 80%); } .work-sample-title { font-size: 1.375rem; font-weight: 600; line-height: 1.3; margin: 0 0 0.75rem; } .work-sample-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; } .work-sample-tag { font-size: 0.8rem; font-weight: 500; background-color: rgba(255,255,255,0.15); padding: 0.25rem 0.75rem; border-radius: 9999px; border: 1px solid rgba(255,255,255,0.3); } </style> <!-- Place the following HTML in your <body> --> <div class="cards-grid-container"> <!-- Card 1 --> <a href="#" class="work-sample-card" aria-labelledby="work-title-1"> <img class="work-sample-image" src="https://placehold.co/800x560/ec4899/ffffff/png?text=Mobile+UI" alt="UI screenshot for the Meridian Finance app."> <div class="work-sample-content"> <h3 class="work-sample-title" id="work-title-1">Meridian Finance App</h3> <div class="work-sample-tags"> <span class="work-sample-tag">UI Design</span> <span class="work-sample-tag">UX Research</span> <span class="work-sample-tag">iOS</span> </div> </div> </a> <!-- Card 2 --> <a href="#" class="work-sample-card" aria-labelledby="work-title-2"> <img class="work-sample-image" src="https://placehold.co/800x560/f59e0b/ffffff/png?text=Branding" alt="Branding materials for a coffee company."> <div class="work-sample-content"> <h3 class="work-sample-title" id="work-title-2">Canyon Coffee Roasters</h3> <div class="work-sample-tags"> <span class="work-sample-tag">Branding</span> <span class="work-sample-tag">Logo Design</span> <span class="work-sample-tag">Packaging</span> </div> </div> </a> <!-- Card 3 --> <a href="#" class="work-sample-card" aria-labelledby="work-title-3"> <img class="work-sample-image" src="https://placehold.co/800x560/06b6d4/ffffff/png?text=Website" alt="Screenshot of the Helios Real Estate website."> <div class="work-sample-content"> <h3 class="work-sample-title" id="work-title-3">Helios Real Estate Website</h3> <div class="work-sample-tags"> <span class="work-sample-tag">Web Design</span> <span class="work-sample-tag">Webflow</span> <span class="work-sample-tag">CMS</span> </div> </div> </a> </div>