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(280px, 1fr)); gap: 1.5rem; padding: 1.5rem; } /* === Quick View Product Card Styles === */ .qv-card { --qv-card-radius: 12px; background-color: #ffffff; border-radius: var(--qv-card-radius); overflow: hidden; display: flex; flex-direction: column; } /* Image container */ .qv-card-image-container { position: relative; /* Context for the overlay and button */ background-color: #f3f4f6; overflow: hidden; /* Clips the hover overlay and button */ } /* The hover-to-show Quick View button */ .qv-quick-view-btn { position: absolute; bottom: 1.2rem; left: 50%; transform: translate(-50%, 150%); /* Start hidden below the card */ background-color: rgba(255, 255, 255, 0.9); backdrop-filter: blur(4px); color: #1f2937; font-size: 0.9rem; font-weight: 500; border: none; border-radius: 8px; padding: 0.75rem 1.5rem; cursor: pointer; transition: transform 0.3s ease-in-out, box-shadow 0.2s ease; z-index: 10; white-space: nowrap; box-shadow: 0 4px 10px rgba(0,0,0,0.1); } /* On hover, move the button into view */ .qv-card-image-container:hover .qv-quick-view-btn { transform: translate(-50%, 0); } /* Dim overlay on hover */ .qv-card-image-container::after { content: ''; position: absolute; inset: 0; background-color: rgba(0,0,0,0); transition: background-color 0.3s ease; z-index: 5; pointer-events: none; /* Allows clicks to go through to the image link */ } .qv-card-image-container:hover::after { background-color: rgba(0,0,0,0.2); } .qv-card-image { width: 100%; height: 320px; object-fit: cover; display: block; transition: transform 0.3s ease; } .qv-card-image-container:hover .qv-card-image { transform: scale(1.05); /* Subtle zoom on image */ } /* Content block styling */ .qv-card-content { padding: 1.25rem; text-align: center; } .qv-card a.qv-card-link { text-decoration: none; color: inherit; } .qv-card a.qv-card-link:hover .qv-card-title { color: #4f46e5; } .qv-card-category { font-size: 0.8rem; color: #6b7280; margin-bottom: 0.25rem; } .qv-card-title { font-size: 1.1rem; font-weight: 600; line-height: 1.4; margin: 0 0 0.5rem; transition: color 0.2s ease; } .qv-card-price { font-size: 1rem; font-weight: 500; color: #111827; } </style> <!-- Place the following HTML in your <body> --> <div class="cards-grid-container"> <!-- Product 1 --> <article class="qv-card"> <div class="qv-card-image-container"> <a href="#" class="qv-card-link" aria-label="View details for Terra Camping Tent"> <!-- Image by placehold.co. Replace with your own. --> <img src="https://placehold.co/600x600/22c55e/ffffff/png?text=Tent" alt="A green and gray camping tent set up in a field." class="qv-card-image"> </a> <button type="button" class="qv-quick-view-btn">Quick View</button> </div> <div class="qv-card-content"> <a href="#" class="qv-card-link"> <div class="qv-card-category">Camping Gear</div> <h3 class="qv-card-title">Terra Camping Tent</h3> <p class="qv-card-price">$249.99</p> </a> </div> </article> <!-- Product 2 --> <article class="qv-card"> <div class="qv-card-image-container"> <a href="#" class="qv-card-link" aria-label="View details for Artisan Ceramic Mug Set"> <!-- Image by placehold.co. Replace with your own. --> <img src="https://placehold.co/600x600/f43f5e/ffffff/png?text=Mugs" alt="A set of handcrafted ceramic mugs with a speckled glaze." class="qv-card-image"> </a> <button type="button" class="qv-quick-view-btn">Quick View</button> </div> <div class="qv-card-content"> <a href="#" class="qv-card-link"> <div class="qv-card-category">Kitchenware</div> <h3 class="qv-card-title">Artisan Ceramic Mug Set</h3> <p class="qv-card-price">$45.00</p> </a> </div> </article> <!-- Product 3 --> <article class="qv-card"> <div class="qv-card-image-container"> <a href="#" class="qv-card-link" aria-label="View details for Linen Throw Blanket"> <!-- Image by placehold.co. Replace with your own. --> <img src="https://placehold.co/600x600/8b5cf6/ffffff/png?text=Blanket" alt="A soft, woven linen throw blanket in a neutral color." class="qv-card-image"> </a> <button type="button" class="qv-quick-view-btn">Quick View</button> </div> <div class="qv-card-content"> <a href="#" class="qv-card-link"> <div class="qv-card-category">Home Goods</div> <h3 class="qv-card-title">Linen Throw Blanket</h3> <p class="qv-card-price">$79.00</p> </a> </div> </article> </div>