There is no universal hero-image pixel size. Choose image files from the hero’s rendered slot at each viewport, its intended crop, and the device pixel density. Keep the composition intentional, provide responsive candidates, declare intrinsic dimensions, and load the above-the-fold image promptly. A 1,920 × 1,080 file is not automatically the right answer for every landing page.
Start with the rendered hero slot, not a stock pixel number
CSS determines how large the hero appears in the layout; the source file determines the ratio and the pixels available for that display. Measure the actual slot at the breakpoints your design uses, then create candidates that cover those materially different sizes. A single desktop-sized asset sent to every phone wastes bandwidth and may still crop badly. web.dev notes that serving desktop-sized images to mobile devices can use 2–4× more data than needed; that figure is historical context from its responsive-images article, not a guaranteed saving for every site.
Record these values before exporting files:
- the hero’s rendered width and height on wide desktop, laptop/tablet, and narrow mobile layouts;
- the crop or object-position at each layout;
- the display pixel density you need to support;
- whether the browser can discover the image in initial HTML or only after CSS or JavaScript runs.
Use those measurements to select candidates. Do not enlarge a small source to fill a larger slot, and do not force a wide composition into a tall mobile box by stretching it.
Choose the composition and aspect ratio
Same composition, different resolutions
If the subject and crop remain suitable from desktop to mobile, keep one composition and export several widths. The browser can select the smallest candidate that covers the rendered slot. This is a resolution problem, not a reason to redesign the crop.
#1 Best Overall
Different composition on mobile
If a narrow crop cuts off the subject, a product screen, or a text-safe area, create a separate mobile composition. This is art direction: the mobile file may have a different aspect ratio and focal point rather than merely fewer pixels. Compare which parts of the scene remain legible, not just the numeric dimensions.
Preserve or deliberately change the ratio
When the design preserves the source ratio, constrain the image with max-inline-size: 100% and block-size: auto. If the component requires a fixed ratio, crop an appropriate variant for that ratio. Stretching a mismatched source produces distortion; letting an uncontrolled ratio change the layout can create unexpected whitespace or overflow.
Use responsive candidates with intrinsic dimensions
For an inline hero, include width and height attributes that describe the source ratio. As web.dev’s responsive-images guide states: “If you know your image’s dimensions, always include width and height attributes.” The browser can reserve the correct aspect-ratio space before the bytes arrive, reducing layout movement, while responsive CSS still lets the image shrink with its container.
The following example uses illustrative candidates and a 16:10 source ratio. Replace the widths, dimensions, and breakpoint expression with measurements from your layout.
<img
src='/images/hero-960.webp'
srcset='/images/hero-480.webp 480w,
/images/hero-960.webp 960w,
/images/hero-1440.webp 1440w'
sizes='(max-width: 700px) 100vw, (max-width: 1200px) 90vw, 1200px'
width='1440'
height='900'
alt='Team reviewing a product dashboard'
loading='eager'
>
srcset supplies width-descriptor candidates; sizes tells the browser how wide the image is expected to render. If the hero is 100% of the viewport on phones but capped inside a desktop container, the sizes expression should describe exactly that behavior. An inaccurate value can make the browser choose a candidate that is too large or too small.
Keep the CSS ratio-safe:
.hero img {
max-inline-size: 100%;
block-size: auto;
display: block;
}
For art-directed crops, use a <picture> source with a media condition and retain a normal <img> fallback. The media condition should match the layout breakpoint where the composition changes; the candidate widths inside each source should still reflect the rendered slot.
Decide how the hero is delivered
Inline <img>
An inline image is appropriate when the hero conveys information. It supports intrinsic dimensions and meaningful alternative text. Put it in the initial markup when it is the principal visual so discovery is not delayed by script execution.
CSS background
A background is useful for decorative imagery behind content, but it can be harder for the browser to discover early when the rule arrives through a stylesheet or JavaScript. If it is the page’s important Largest Contentful Paint (LCP) image, inspect the actual network request and discovery timing rather than assuming the CSS is early enough. A background also does not provide image alternative text; expose any essential meaning in the surrounding HTML.
Recommended Free Tools
Manual files versus an image service
| Approach | Best fit | Trade-off to check |
|---|---|---|
| Manual responsive variants | A small number of stable landing pages | Maximum crop control, but you maintain exports and markup. |
| Automated image service | Many pages, locales, or frequently changing assets | Less manual work, but evaluate integration, crop control, formats, and delivery cost. |
| Inline image | Content-bearing hero | Intrinsic dimensions and alt text; ensure early discovery. |
| CSS background | Decorative or layered visual | Discovery can be later; no intrinsic dimensions or alt text on the background itself. |
No single delivery method is required for every landing page. Choose based on semantic role and then verify the resource the browser actually downloads.
Set loading priority without hurting the rest of the page
A visible hero is above the fold, so do not mark it loading='lazy'. If it is genuinely the page’s key LCP image, loading='eager' and fetchpriority='high' can communicate priority. Use high priority selectively: promoting several images, fonts, or scripts at once can make them compete with one another.
Preload only when the important image would otherwise be discovered late, such as a background introduced by CSS or an image inserted by JavaScript. Overusing preload can compete with stylesheets, fonts, scripts, and other critical resources. The LCP definition and behavior are documented in the web.dev LCP source.
Formats, bytes, and the “right” candidate
Pixel dimensions alone do not determine speed. Encoding format, visual quality, compression, delivery path, and the browser-selected candidate all affect the transfer. The web.dev image-performance guide recommends delivering an image close to its displayed dimensions and maintaining suitable variants. There is no universal byte ceiling or mandated hero ratio in the guidance; set a practical budget from your page’s audience and measure the result.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Rank #4
After implementation, inspect the page at representative viewport widths and device pixel ratios. In browser developer tools, confirm which srcset candidate was requested, its decoded dimensions, and whether the image request competes with CSS, fonts, or scripts. Field or lab performance data is the final check: a theoretically correct source cannot guarantee a fast LCP if the layout, encoding, or delivery path is slow.
A repeatable sizing workflow
- Measure the slots. Write down rendered width and height for each material layout, including the mobile crop.
- Choose the composition. Keep one crop when it remains legible; create art-directed variants when the focal point or text-safe area changes.
- Export candidates. Provide several widths around the measured slots rather than one oversized desktop file. Keep each file’s intrinsic ratio honest.
- Implement the selection. Add
srcset, a layout-accuratesizesvalue, and intrinsicwidth/height. Use<picture>for different compositions. - Protect the layout. Apply
max-inline-size: 100%andblock-size: auto, or crop a deliberate fixed-ratio variant. - Set loading behavior. Keep an above-the-fold hero out of lazy loading. Add eager loading or high fetch priority only when it is truly critical; preload only for late discovery.
- Verify delivery. Test real breakpoints, inspect the selected network resource, and check LCP and layout movement in lab and field data.
Troubleshooting common hero-image failures
The mobile hero looks soft
Check whether the mobile slot is receiving a candidate with enough source pixels and whether sizes understates the rendered width. Also verify that an image service or cache is not returning a smaller derivative than intended.
The subject is cut off on phones
Do not solve a composition problem by increasing resolution. Supply an art-directed mobile crop with a suitable focal point, then select it through <picture> at the mobile breakpoint.
The page jumps while the hero loads
Confirm that the width and height attributes describe the actual source ratio and that CSS does not override the ratio unexpectedly. A mismatched pair reserves the wrong amount of space.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsBest Value
The hero is slow despite a small file
Inspect discovery timing and request order. A CSS or JavaScript background may be discovered late; an overly aggressive preload or several high-priority requests may also create contention. Check the selected candidate, encoding, server delivery, and LCP resource together.
The desktop file is downloaded on every phone
Review the srcset and sizes syntax, breakpoint conditions, and cache behavior. The browser can only choose efficiently when the candidates and expected rendered widths describe the real layout.
Or skip the browser setup
To inspect how your landing page actually renders at different viewports, ScreenshotNeo can return a screenshot from one GET request. It supports full-page capture, 12 device presets or a custom viewport, retina scale, dark mode, element capture by CSS selector, waits for a selector, delay or network idle, custom CSS and JavaScript, and PDF output. Those options let you check the hero crop and layout without manually opening each browser size.
Example request (replace the URL and key):
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the complete parameter list in the ScreenshotNeo documentation. The same call from Python is:
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchQuick Recap
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
And in Node.js:
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
ScreenshotNeo accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and the response identifies the page verdict and billing status in X-Page-Verdict and X-Billed headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots, and every feature is on every plan. Create a free ScreenshotNeo account to test your responsive hero renders.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




