Sub topic 7
Pick a visual that shows the product or outcome
The visual in a hero supports the offer. It does not replace the headline. This chapter covers how to choose a visual that backs up the claim the headline makes, how to mark it up so it loads fast and stays accessible, and the mistakes that make a hero image work against you.
We assume you can write basic HTML and CSS and that you already have a headline, subheadline and primary call to action (CTA) from the earlier chapters. The running example is Ledgerly, an invoicing tool for freelancers, with the headline "Send invoices in under a minute".
What the visual is for
A visitor reads the headline first. The visual then answers a different question: "Is this real, and what would it look like for me?" A good hero visual does one of three jobs:
- It shows the product, so the visitor sees the interface they would use.
- It shows the outcome, so the visitor sees the result they want, such as a paid invoice or a finished report.
- It shows the context, so the visitor sees someone like them using the product.
A visual that does none of these is decoration. It uses bandwidth and attention without supporting the offer.
Compare the main visual types
Each type has strengths and failure modes. Choose based on what your headline claims.
| Visual type | Best when | Main risk |
|---|---|---|
| Product screenshot | The product is software and the interface is the selling point | Too much detail, unreadable at small sizes |
| Cropped or simplified UI | The screenshot has too many controls to read at a glance | Looks fake if it does not match the real product |
| Outcome image | The result matters more than the tool (a tidy kitchen, a booked trip) | Vague if it could belong to any company |
| Photo of a person | Trust and relatability matter, such as services or coaching | Generic stock photos weaken credibility |
| Short looping video | Motion explains the product better than a still | Large files, autoplay problems, motion sensitivity |
| Illustration | The product is abstract or the brand is playful | Does not prove the product exists |
For Ledgerly, the headline promises speed. A screenshot of the invoice editor with a visible Send button shows the short path from draft to sent. A photo of a smiling person at a laptop shows nothing about the product.
Test the visual against the headline
Before you pick an image, run a quick check. Cover the headline and look only at the visual. Then answer two questions:
- Can a visitor tell what kind of product this is?
- Does the image suggest the benefit the headline states?
If the answer to both is no, the visual is not supporting the offer. Change the image or crop it so the relevant part is clear.
A common fix for a crowded screenshot is to crop to the one area that proves the claim. For Ledgerly, that means the invoice with line items and the Send button, not the full dashboard with sidebar, notifications and settings.
Mark up the visual correctly
The hero from the Topic Spine uses a single img element with three things worth understanding: explicit dimensions, a priority hint, and descriptive alt text.
<img class="hero__image"
src="/img/invoice-editor.webp"
width="640" height="400"
fetchpriority="high"
alt="Ledgerly invoice editor showing a draft invoice with a Send button">Explicit width and height
The width and height attributes tell the browser the image's aspect ratio before the file arrives. The browser reserves that space. Without them, the page content jumps when the image loads, which hurts the Cumulative Layout Shift (CLS) score and annoys readers who have started reading.
The attributes set an aspect ratio, not a fixed size. The CSS rule width: 100%; height: auto; still lets the image scale with its container while keeping the reserved ratio.
Priority hint
The hero image is usually the Largest Contentful Paint (LCP) element, which is the biggest visible item that browsers measure when judging load speed. fetchpriority="high" tells the browser to download it early. Use it on the hero image only. If you mark many images as high priority, none of them stands out.
Never add loading="lazy" to the hero image. Lazy loading delays images until they are near the viewport, and the hero is already in the viewport at load. Lazy loading it delays the very element you want to appear first.
Alt text
The alt attribute is the text a screen reader reads aloud and the text a browser shows if the image fails to load. Write it to describe what the image shows and why it matters, in one sentence. Compare:
| Alt text | Problem |
|---|---|
| `image` | Says nothing |
| `invoice-editor.webp` | Reads the file name |
| `Screenshot of software` | Too generic to help |
| `Ledgerly invoice editor showing a draft invoice with a Send button` | Names the product and what is visible |
If an image is purely decorative, use an empty alt="" so screen readers skip it. Do not omit the attribute. A missing alt makes some screen readers read the file name instead.
Choose a format and size
Modern formats are smaller than older ones at the same visual quality. WebP and AVIF are widely supported. Use picture to offer a newer format with a fallback, and srcset to let the browser pick a size that fits the screen.
<picture>
<source type="image/avif"
srcset="/img/invoice-editor-640.avif 640w, /img/invoice-editor-1280.avif 1280w"
sizes="(min-width: 48rem) 50vw, 100vw">
<source type="image/webp"
srcset="/img/invoice-editor-640.webp 640w, /img/invoice-editor-1280.webp 1280w"
sizes="(min-width: 48rem) 50vw, 100vw">
<img class="hero__image"
src="/img/invoice-editor-640.webp"
width="640" height="400"
fetchpriority="high"
alt="Ledgerly invoice editor showing a draft invoice with a Send button">
</picture>The sizes attribute describes how wide the image will be on screen: half the viewport on wide screens (matching the two-column grid) and the full width on narrow ones. The browser combines this with the screen density to choose a file from srcset. Two widths are enough for most heroes. The 1280 pixel file serves high-density screens, where 640 CSS pixels needs 1280 real pixels to look sharp.
As a rough budget, aim for a hero image under about 100 to 150 KB. If your file is much larger, reduce the dimensions, raise compression, or crop tighter before reaching for other fixes.
Place the visual in the layout
On small screens the hero is one column, so the image sits below the text. On wider screens the grid splits into two columns. The image stays in the HTML after the text so that a keyboard or screen reader user meets the headline first.
If you want the image above the text on phones, change the visual order with CSS order rather than moving the HTML. Test this carefully, because the visual order and the reading order then differ. Usually it is better to leave the text first: on a phone, the headline and CTA should stay within the first screen, and a tall image above them pushes both down.
.hero__image {
width: 100%;
height: auto;
border-radius: 0.5rem;
}Check a few cases:
- On a 360 px wide phone, are the headline and CTA still visible before the image pushes them down?
- On a wide monitor, does the image stay sharp without becoming huge? Set a
max-widthon the hero container, as the example from the layout chapter does with72rem. - Does the image still make sense when cropped? If the key detail sits at the edge, a crop on small screens may cut it off. Use
object-fit: coverwithobject-positionto keep the important area in view if you fix the image height.
Video and motion
A looping product video can show a workflow better than a still. It also brings costs: larger files, slower loading and accessibility concerns.
If you use video in a hero:
- Keep it muted, short and looping, and add the
muted,playsinlineandloopattributes. Browsers block autoplay with sound. - Provide a
posterimage so something appears immediately. That poster is usually your LCP element, so treat it like a hero image. - Offer a way to pause it. Moving content that lasts more than five seconds needs a pause control under WCAG 2.2.2.
- Respect
prefers-reduced-motion. Some people get dizzy or distracted by motion, and their operating system lets them say so.
@media (prefers-reduced-motion: reduce) {
.hero__video {
display: none;
}
}If you hide the video this way, make sure a static image shows instead, or the hero loses its visual.
Common mistakes
- Stock photo with no connection to the product. Visitors recognize generic office photos and read them as filler.
- Screenshot too small to read. If the text in the image is illegible at phone size, crop or redraw it.
- Text baked into the image. Screen readers cannot read it, it does not scale, and it cannot be translated. Keep the headline and CTA as HTML text.
- Image competing with the CTA. A bright, busy image pulls the eye away from the button. Keep contrast and color highest on the CTA.
- Oversized files. A 2 MB PNG as a hero delays LCP on mobile networks.
- Lazy loading the hero image. This delays the most important element.
Checking your choice
Use this short list before moving on:
- The visual shows the product or outcome named in the headline.
- It is readable at 360 px wide.
- It has
width,height, descriptivealttext, andfetchpriority="high". - It is not lazy loaded.
- It is under your size budget in a modern format.
- It does not draw attention away from the CTA.
Exercise
A hero for a meal-planning app has the headline "Plan a week of dinners in five minutes". The designer proposes a full-width stock photo of a smiling family at a dinner table, with the headline in white text over it, and loading="lazy" on the image to save bandwidth. Name three problems and say how you would fix each.
Show answer
First, the photo does not show the product or the five-minute claim. Replace it with a cropped screenshot of a finished weekly plan, or a photo of the plan on a phone next to the food. Second, white text over a photo may fail contrast in lighter areas. Put the headline in a solid area beside the image, or add an overlay and check the lowest-contrast spot. Third, loading="lazy" delays the hero image, which is likely the LCP element. Remove it, add fetchpriority="high", and set width and height so the layout does not shift.
Exercise
Why do you set width and height attributes on the hero image when the CSS already sets width: 100%; height: auto;?
Show answer
The attributes give the browser the image's aspect ratio before the file downloads, so it reserves the right amount of space and the page does not jump when the image appears. The CSS then lets the image scale to its container while keeping that ratio.