Sub topic 3
Lay Out the Hero Above the Fold
Assume you know basic HTML and CSS, understand homepage structure, and know what a call to action (CTA) is. A hero is the prominent section near the top of a homepage. Its layout should make the offer, supporting detail, and one primary CTA easy to find before most visitors scroll.
Lay Out the Hero Above the Fold
Use visual hierarchy, the order in which elements attract attention, to guide the visitor:
- Headline: state the main outcome.
- Subheadline: explain who it helps and how.
- Primary CTA: describe the next result, such as “Start free trial.”
- Supporting visual: show the product or outcome.
- Trust signal: reduce doubt without competing with the CTA.
Keep the first screen focused. “Above the fold” means the content visible before scrolling, but its exact height differs by device. Do not force every detail into that area.
Make the Hero Work from Phone to Desktop
Start with a single-column layout for narrow screens. At a wider breakpoint, place text and the visual in two columns. Keep the text column narrow enough to read comfortably.
<section class="hero" aria-labelledby="hero-title">
<div>
<h1 id="hero-title">Send invoices in under a minute</h1>
<p>Ledgerly helps freelancers create, send, and track invoices.</p>
<a class="cta" href="/signup">Start free trial</a>
</div>
<img src="/img/invoice-editor.webp" width="640" height="400"
alt="Invoice editor showing a draft invoice">
</section>
<style>
.hero {
display: grid;
gap: 2rem;
align-items: center;
max-width: 72rem;
margin: auto;
padding: 3rem 1.25rem;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
.hero img { width: 100%; height: auto; }
@media (min-width: 48rem) {
.hero { grid-template-columns: 1fr 1fr; }
}
</style>Keep the Hero Fast to Load
Use an appropriately sized, compressed image. Set width and height to reserve space and prevent layout shifts. Give the main hero image high loading priority only when it is visible immediately. Avoid autoplay video and heavy decorative effects.
Make the Hero Usable for Everyone
Use one h1, semantic elements, descriptive alternative text, and a real link or button for the CTA. Check keyboard focus, color contrast, zoom behavior, and reduced-motion preferences. Do not communicate meaning through color alone.
> callout note > The visual should support the offer. If visitors must study it to understand the page, simplify the headline or image.
Test and Refine Hero Variants
Test one meaningful change at a time, such as a benefit-focused headline versus a feature-focused headline. Keep the audience, traffic source, and success metric consistent. Measure CTA clicks and completed sign-ups, not clicks alone.
Review the Hero Against a Checklist
- Can a first-time visitor name the offer quickly?
- Is there one obvious primary CTA?
- Does the layout work without horizontal scrolling?
- Is the image useful, sized, and described?
- Does the hero remain usable with a keyboard and screen reader?
- Does it load without a visible shift?
Exercise
What should you change first if the hero has several competing buttons?
Show answer
Keep one primary CTA, move secondary actions away from the main visual path, and measure whether the primary action becomes clearer.