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 Kody Goodson. Replace with your own inspirational travel photo. */ --tih-bg-image: url('https://images.unsplash.com/photo-1505852679233-d9fd70aff56d?q=80&w=1470'); --tih-min-height: 100vh; --tih-padding: 3rem 1.5rem; --tih-text-color: #ffffff; --tih-overlay-color: rgba(15, 23, 42, 0.5); /* A slate overlay */ --tih-cta-border-color: #f8fafc; --tih-cta-hover-bg: #f8fafc; --tih-cta-hover-text: #0f172a; --tih-max-width: 1100px; } .travel-inspiration-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(--tih-min-height); padding: var(--tih-padding); width: 100%; position: relative; display: flex; justify-content: center; align-items: center; text-align: center; background-image: var(--tih-bg-image); background-size: cover; background-position: center; } .travel-inspiration-hero::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--tih-overlay-color); z-index: 1; } .travel-inspiration-hero * { box-sizing: border-box; } .tih-content { position: relative; z-index: 2; max-width: var(--tih-max-width); color: var(--tih-text-color); } .tih-content .title { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 700; line-height: 1.2; margin: 0 0 1rem; text-shadow: 0 2px 4px rgba(0,0,0,0.2); } .tih-content .subtitle { font-size: clamp(1.1rem, 3vw, 1.25rem); margin: 0 0 2.5rem; opacity: 0.9; } .tih-content .cta { display: inline-block; background: transparent; color: var(--tih-text-color); border: 2px solid var(--tih-cta-border-color); padding: 0.8rem 2.2rem; border-radius: 8px; font-size: 1rem; font-weight: 600; text-decoration: none; cursor: pointer; transition: background-color 0.3s ease, color 0.3s ease; } .tih-content .cta:hover { background-color: var(--tih-cta-hover-bg); color: var(--tih-cta-hover-text); } </style> <!-- ====================================================================== HTML - Place this in your <body> where you want the component to appear. ====================================================================== --> <section class="travel-inspiration-hero"> <div class="tih-content"> <h1 class="title">Go Find Your Elsewhere</h1> <p class="subtitle">The world is full of wonder, and it's time to discover your own piece of it.</p> <a href="#" role="button" class="cta">Find a Destination</a> </div> </section>