Toggle navigation
☰
Home
HTML
CSS
Scripting
Database
<!DOCTYPE html> <title>My Example</title> <!-- ====================================================================== CSS - Place this in your <head> or in an external stylesheet. ====================================================================== --> <style> :root { --psh-padding: 1.5rem; --psh-max-width: 1200px; --psh-gap: 2rem; --psh-text-color: #1a1a1a; --psh-bg-color: #ffffff; --psh-cta-bg: #0056b3; --psh-cta-hover-bg: #004494; --psh-cta-text: #ffffff; --psh-price-color: #007bff; } .prod-showcase-hero { box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: var(--psh-bg-color); color: var(--psh-text-color); width: 100%; display: flex; flex-direction: column; align-items: center; padding: var(--psh-padding); } .prod-showcase-hero * { box-sizing: border-box; } .prod-showcase-hero-container { width: 100%; max-width: var(--psh-max-width); display: flex; flex-direction: column; gap: var(--psh-gap); } .prod-showcase-hero-image-wrapper { width: 100%; margin: 0; display: flex; justify-content: center; align-items: center; } .prod-showcase-hero-image { width: 100%; height: auto; max-width: 480px; object-fit: cover; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); } .prod-showcase-hero-content { text-align: center; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 1rem; } .prod-showcase-hero-title { font-size: clamp(2rem, 5vw, 2.75rem); margin: 0; font-weight: 700; line-height: 1.2; } .prod-showcase-hero-description { margin: 0; max-width: 500px; font-size: 1rem; line-height: 1.6; } .prod-showcase-hero-price { font-size: 1.75rem; font-weight: 600; color: var(--psh-price-color); margin: 0; } .prod-showcase-hero-cta { background-color: var(--psh-cta-bg); color: var(--psh-cta-text); border: none; padding: 0.8rem 1.6rem; font-size: 1rem; font-weight: 600; border-radius: 5px; cursor: pointer; text-decoration: none; transition: background-color 0.3s ease; margin-top: 1rem; display: inline-block; } .prod-showcase-hero-cta:hover { background-color: var(--psh-cta-hover-bg); } @media (min-width: 768px) { .prod-showcase-hero { padding: calc(var(--psh-padding) * 2); } .prod-showcase-hero-container { flex-direction: row; align-items: center; } .prod-showcase-hero-image-wrapper { flex: 1 1 50%; order: 2; /* Image on the right */ } .prod-showcase-hero-content { flex: 1 1 50%; order: 1; /* Content on the left */ text-align: left; align-items: flex-start; } } </style> <!-- ====================================================================== HTML - Place this in your <body> where you want the component to appear. ====================================================================== --> <section class="prod-showcase-hero"> <div class="prod-showcase-hero-container"> <figure class="prod-showcase-hero-image-wrapper"> <!-- Image by Artiom Vallat from Unsplash. Using a direct link for demonstration. For production, host your own image. --> <img class="prod-showcase-hero-image" src="https://images.unsplash.com/photo-1523275335684-37898b6baf30?q=80&w=1000" alt="A modern, silver and black wristwatch displayed on a white surface."> </figure> <div class="prod-showcase-hero-content"> <h1 class="prod-showcase-hero-title">The Chronos S-Model</h1> <p class="prod-showcase-hero-price">$499.99</p> <p class="prod-showcase-hero-description"> Experience precision engineering and timeless design. The Chronos S-Model features a sapphire crystal face, stainless steel case, and a self-winding mechanism that stands the test of time. </p> <button type="button" class="prod-showcase-hero-cta">Add to Cart</button> </div> </div> </section>