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: #f9fafb; 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; } /* === Metadata Blog Card Styles === */ .bmt-card { --bmt-card-radius: 12px; --bmt-card-shadow: 0 4px 10px rgba(0,0,0,0.06); position: relative; /* Positioning context for the stretched link */ background-color: #ffffff; border-radius: var(--bmt-card-radius); box-shadow: var(--bmt-card-shadow); display: flex; flex-direction: column; overflow: hidden; transition: box-shadow 0.2s ease, transform 0.2s ease; } .bmt-card:hover { transform: translateY(-5px); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1); } .bmt-card-image { width: 100%; height: 200px; object-fit: cover; display: block; } .bmt-card-content { padding: 1.25rem 1.5rem; flex-grow: 1; display: flex; flex-direction: column; } /* Metadata bar: category & reading time */ .bmt-card-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; font-size: 0.875rem; } /* Category tag link must have a higher z-index to be clickable */ .bmt-category-tag { position: relative; z-index: 1; background-color: #eef2ff; color: #4338ca; padding: 0.25rem 0.75rem; border-radius: 9999px; font-weight: 500; text-decoration: none; transition: background-color 0.2s ease; } .bmt-category-tag:hover { background-color: #e0e7ff; } .bmt-reading-time { display: flex; align-items: center; gap: 0.35rem; color: #6b7280; } .bmt-reading-time svg { width: 16px; height: 16px; } .bmt-card-title { font-size: 1.25rem; font-weight: 600; line-height: 1.4; margin: 0 0 auto; /* Pushes author down */ padding-bottom: 0.75rem; } /* The stretched link. This link stretches out over the whole card. This allows us to make the entire card clickable while allowing the category tag to be a separate, valid link. */ .bmt-stretched-link { text-decoration: none; color: inherit; transition: color 0.2s ease; } .bmt-stretched-link:hover { color: #4338ca; } .bmt-stretched-link::after { content: ''; position: absolute; inset: 0; z-index: 0; /* Sits behind other links but covers the card */ } /* Author info */ .bmt-card-author { display: flex; align-items: center; gap: 0.75rem; margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid #f3f4f6; } .bmt-card-author-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; } .bmt-card-author-name { font-weight: 500; } </style> <!-- Place the following HTML in your <body> --> <div class="cards-grid-container"> <!-- Card 1 --> <article class="bmt-card"> <img src="https://placehold.co/800x400/22d3ee/ffffff/png?text=React" alt="Abstract shapes representing React." class="bmt-card-image"> <div class="bmt-card-content"> <div class="bmt-card-meta"> <a href="#" class="bmt-category-tag">React</a> <span class="bmt-reading-time"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path fill-rule="evenodd" d="M1 8a7 7 0 1114 0A7 7 0 011 8zm7.75-4.25a.75.75 0 00-1.5 0V8c0 .414.336.75.75.75h3.25a.75.75 0 000-1.5H8.5V3.75z" clip-rule="evenodd"/></svg> 8 min read</span> </div> <h3 class="bmt-card-title" id="bmt-title-1"> <a href="#" class="bmt-stretched-link" aria-labelledby="bmt-title-1"> State Management in Modern React </a> </h3> <footer class="bmt-card-author"> <img src="https://placehold.co/80x80/666/fff/png?text=AZ" alt="Avatar of Adelaide Vance" class="bmt-card-author-avatar"> <span class="bmt-card-author-name">Adelaide Vance</span> </footer> </div> </article> </div>