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; } /* === Video Preview Card Styles === */ .video-card { --video-radius: 12px; --video-shadow: 0 4px 10px rgba(0,0,0,0.08); background-color: #ffffff; border-radius: var(--video-radius); box-shadow: var(--video-shadow); display: flex; flex-direction: column; overflow: hidden; } .video-card-link { display: block; text-decoration: none; color: inherit; } .video-card-link:hover .video-card-title { color: #4f4e45; } .video-card-thumbnail-container { position: relative; overflow: hidden; background-color: #111827; /* Fallback */ } /* Thumbnail image */ .video-card-thumbnail { width: 100%; height: 180px; object-fit: cover; display: block; transition: transform 0.3s ease, filter 0.3s ease; } .video-card-thumbnail-container:hover .video-card-thumbnail { transform: scale(1.05); filter: brightness(0.9); } /* Gradient overlay for text */ .video-card-thumbnail-container::before { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 70%); } /* Play Button */ .video-play-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background-color: rgba(255,255,255,0.2); backdrop-filter: blur(8px); width: 60px; height: 60px; border-radius: 50%; border: 2px solid #ffffff; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background-color 0.2s ease, transform 0.2s ease; } .video-play-btn svg { width: 28px; height: 28px; color: #ffffff; margin-left: 4px; /* Optical alignment for play icon */ } .video-card-thumbnail-container:hover .video-play-btn { background-color: rgba(255,255,255,0.3); transform: translate(-50%, -50%) scale(1.05); } /* Video info overlaid on thumbnail */ .video-info-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 1rem; color: #ffffff; text-shadow: 1px 1px 3px rgba(0,0,0,0.5); } .video-info-overlay .video-card-title { margin-bottom: 0; } .video-info-overlay .video-card-duration { font-size: 0.875rem; font-weight: 500; } /* Description area below the thumbnail */ .video-card-body { padding: 1.25rem; } .video-card-description { font-size: 0.95rem; line-height: 1.6; color: #4b5563; margin: 0; } </style> <!-- Place the following HTML in your <body> --> <div class="cards-grid-container"> <!-- Card 1 --> <article class="video-card"> <a href="#" class="video-card-link"> <div class="video-card-thumbnail-container"> <img src="https://placehold.co/800x360/475569/ffffff/png?text=Vlog" alt="Thumbnail for a travel vlog." class="video-card-thumbnail"> <div class="video-play-btn" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M4.5 5.653c0-1.426 1.529-2.33 2.779-1.643l11.54 6.647c1.295.748 1.295 2.535 0 3.284L7.279 20.99c-1.25.715-2.779-.217-2.779-1.643V5.653z" clip-rule="evenodd" /></svg></div> <div class="video-info-overlay"> <h3 class="video-card-title">Kyoto in 4K</h3> <span class="video-card-duration">14:32</span> </div> </div> <div class="video-card-body"> <p class="video-card-description">A cinematic journey through the ancient temples and vibrant streets of Kyoto, Japan.</p> </div> </a> </article> <!-- Card 2 --> <article class="video-card"> <a href="#" class="video-card-link"> <div class="video-card-thumbnail-container"> <img src="https://placehold.co/800x360/f59e0b/ffffff/png?text=Tutorial" alt="Thumbnail for a cooking tutorial." class="video-card-thumbnail"> <div class="video-play-btn" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M4.5 5.653c0-1.426 1.529-2.33 2.779-1.643l11.54 6.647c1.295.748 1.295 2.535 0 3.284L7.279 20.99c-1.25.715-2.779-.217-2.779-1.643V5.653z" clip-rule="evenodd" /></svg></div> <div class="video-info-overlay"> <h3 class="video-card-title">The Perfect Omurice</h3> <span class="video-card-duration">8:15</span> </div> </div> <div class="video-card-body"> <p class="video-card-description">Chef Motokichi Yokota shares his secrets to creating the perfect tornado omurice at home.</p> </div> </a> </article> </div>