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; } /* === Blog Post Preview Card Styles === */ .blog-card { --blog-card-radius: 12px; --blog-card-shadow: 0 4px 10px rgba(0,0,0,0.06); background-color: #ffffff; border-radius: var(--blog-card-radius); box-shadow: var(--blog-card-shadow); display: flex; flex-direction: column; overflow: hidden; transition: box-shadow 0.2s ease, transform 0.2s ease; } .blog-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); } .blog-card-link { text-decoration: none; color: inherit; display: block; /* This makes the link itself a flex container to push down the footer */ display: flex; flex-direction: column; flex-grow: 1; } .blog-card-image { width: 100%; height: 200px; object-fit: cover; display: block; flex-shrink: 0; } .blog-card-content { padding: 1.25rem 1.5rem; flex-grow: 1; } .blog-card-category { font-size: 0.8rem; font-weight: 500; text-transform: uppercase; color: #4f46e5; margin-bottom: 0.5rem; } .blog-card-title { font-size: 1.25rem; font-weight: 600; line-height: 1.4; margin: 0 0 0.75rem; } .blog-card-link:hover .blog-card-title { color: #4f46e5; } .blog-card-excerpt { font-size: 1rem; line-height: 1.6; color: #4b5563; margin: 0; } /* Author info */ .blog-card-author { display: flex; align-items: center; gap: 0.75rem; padding: 1.25rem 1.5rem; /* Matches content padding */ border-top: 1px solid #f3f4f6; flex-shrink: 0; /* Prevents footer from shrinking */ } .blog-card-author-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; } .blog-card-author-details { line-height: 1.4; } .blog-card-author-name { font-weight: 500; margin: 0; } .blog-card-author-date { font-size: 0.875rem; color: #6b7280; margin: 0; } </style> <!-- Place the following HTML in your <body> --> <div class="cards-grid-container"> <!-- Card 1 --> <article class="blog-card"> <a href="#" class="blog-card-link" aria-labelledby="blog-title-1"> <img src="https://placehold.co/800x400/818cf8/ffffff/png?text=CSS" alt="Abstract shapes representing CSS concepts." class="blog-card-image"> <div class="blog-card-content"> <p class="blog-card-category">CSS & Design</p> <h3 class="blog-card-title" id="blog-title-1">Modern CSS Techniques You Should Know in 2025</h3> <p class="blog-card-excerpt">Explore powerful new features like container queries, cascade layers, and advanced color functions that are changing the way we build websites. </p> </div> </a> <footer class="blog-card-author"> <img src="https://placehold.co/80x80/666/fff/png?text=AZ" alt="Avatar of Adelaide Vance" class="blog-card-author-avatar"> <div class="blog-card-author-details"> <p class="blog-card-author-name">Adelaide Vance</p> <time class="blog-card-author-date" datetime="2025-09-05">September 5, 2025</time> </div> </footer> </article> <!-- Card 2 --> <article class="blog-card"> <a href="#" class="blog-card-link" aria-labelledby="blog-title-2"> <img src="https://placehold.co/800x400/34d399/ffffff/png?text=JS" alt="Abstract shapes representing JavaScript." class="blog-card-image"> <div class="blog-card-content"> <p class="blog-card-category">JavaScript</p> <h3 class="blog-card-title" id="blog-title-2">Mastering Asynchronous JavaScript</h3> <p class="blog-card-excerpt">From callbacks to Promises and async/await, this guide breaks down complex asynchronous patterns.</p> </div> </a> <footer class="blog-card-author"> <img src="https://placehold.co/80x80/333/fff/png?text=BX" alt="Avatar of Barnaby Wexler" class="blog-card-author-avatar"> <div class="blog-card-author-details"> <p class="blog-card-author-name">Barnaby Wexler</p> <time class="blog-card-author-date" datetime="2025-09-02">September 2, 2025</time> </div> </footer> </article> <!-- Card 3 --> <article class="blog-card"> <a href="#" class="blog-card-link" aria-labelledby="blog-title-3"> <img src="https://placehold.co/800x400/fb923c/ffffff/png?text=Tools" alt="Abstract shapes representing web development tools." class="blog-card-image"> <div class="blog-card-content"> <p class="blog-card-category">Developer Tools</p> <h3 class="blog-card-title" id="blog-title-3">Top 5 Productivity Tools for Developers</h3> <p class="blog-card-excerpt">Discover the tools that can streamline your workflow, automate tedious tasks, and help you ship code faster and with fewer bugs.</p> </div> </a> <footer class="blog-card-author"> <img src="https://placehold.co/80x80/999/fff/png?text=CR" alt="Avatar of Caspian Rowe" class="blog-card-author-avatar"> <div class="blog-card-author-details"> <p class="blog-card-author-name">Caspian Rowe</p> <time class="blog-card-author-date" datetime="2025-08-28">August 28, 2025</time> </div> </footer> </article> </div>