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 { /* Demonstration image from Unsplash by Kilarov Zaneit. Replace with your own destination photo. */ --dph-bg-image: url('https://images.unsplash.com/photo-1476514525535-07fb3b4ae5f1?q=80&w=1470'); --dph-min-height: 100vh; --dph-padding: 3rem 1.5rem; --dph-text-color: #ffffff; --dph-overlay-color: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 100%); --dph-cta-bg: #1d4ed8; --dph-cta-text-color: #ffffff; --dph-cta-hover-bg: #1e40af; } .destination-photo-hero { box-sizing: border-box; font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; min-height: var(--dph-min-height); padding: var(--dph-padding); width: 100%; position: relative; display: flex; justify-content: center; align-items: center; text-align: center; background-image: var(--dph-bg-image); background-size: cover; background-position: center; } .destination-photo-hero::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-image: var(--dph-overlay-color); z-index: 1; } .destination-photo-hero * { box-sizing: border-box; } .dph-content { position: relative; z-index: 2; max-width: 800px; color: var(--dph-text-color); } .dph-content .title { font-size: clamp(2.5rem, 8vw, 5rem); font-weight: 800; line-height: 1.1; margin: 0 0 1rem; text-shadow: 0 2px 8px rgba(0,0,0,0.4); } .dph-content .subtitle { font-size: clamp(1.1rem, 3vw, 1.3rem); margin: 0 0 2rem; font-weight: 400; } .dph-content .cta { display: inline-block; background-color: var(--dph-cta-bg); color: var(--dph-cta-text-color); padding: 0.9rem 2.2rem; border-radius: 8px; border: none; font-size: 1.05rem; font-weight: 600; text-decoration: none; cursor: pointer; transition: background-color 0.3s ease; } .dph-content .cta:hover { background-color: var(--dph-cta-hover-bg); } </style> <!-- ====================================================================== HTML - Place this in your <body> where you want the component to appear. ====================================================================== --> <section class="destination-photo-hero"> <div class="dph-content"> <h1 class="title">Explore Emerald Lake</h1> <p class="subtitle">Your unforgettable alpine escape awaits. Pristine waters, mountain vistas, and pure adventure.</p> <a href="#" role="button" class="cta">Discover a Tour</a> </div> </section>