On this page
What this issue is
Browsers scan the HTML early to find images, scripts and styles to download. This is called the preload scanner. It finds <img> tags in the HTML straight away. It does not see images that are only referenced inside CSS, such as background-image: url(hero.jpg).
For a CSS background, the browser must first download the stylesheet, parse it, work out which element uses the rule, and only then request the image. On a slow phone connection that extra wait can add a second or more before the hero even begins to download.
Largest Contentful Paint (LCP) is the time until the biggest visible element on screen is drawn. On many landing pages that element is the hero image, so a late-discovered background directly raises your LCP.
.hero {
background-image: url('/images/hero.jpg');
background-size: cover;
min-height: 600px;
}- HTML arrivesBrowser starts reading the page
- CSS downloadedStylesheet fetched and parsed
- Hero image foundOnly now does the browser see the url()
- Image downloadsStarts late, competes with other files
- LCP paintedVisitor sees the hero much later
The image request waits behind the HTML, the stylesheet and the style calculation.
Why it costs you leads or sales
Visitors from ads or search judge a page in the first moments. If the main visual and headline area stay empty or jump in late, some leave before they see your offer. Slow LCP on a paid landing page also means you pay for clicks that never get a real look at the page.
The effect is usually worst on mobile, where connections are slower and the stylesheet is often large. Page builders and themes that set hero sections as backgrounds by default make this very common.
Example: illustrative LCP times for the same hero image, before and after moving it out of CSS. Your numbers will differ.
How to check if your site has it
Run PageSpeed Insights
Test your landing page URL at pagespeed.web.dev on the mobile tab. Open the LCP breakdown in the diagnostics.
Read the LCP element
Under 'Largest Contentful Paint element', check whether it is an
<img>or a<div>/<section>with a background image. A block element with a background points to this issue.Look at the LCP phases
In Chrome DevTools, open the Performance panel and record a page load. A large 'resource load delay' (time before the image request starts) is the signature of late discovery.
Check the Network panel
Reload with the Network tab open and throttling set to Fast 4G. If the hero image request starts after the CSS file finishes, the browser found it through the stylesheet.
Search the source
View page source and search for the hero file name. If it appears only in CSS or in an inline
style="background-image"and not in an<img>tag or a preload link, it is discovered late.
How to fix it
The best fix is to make the hero a real <img> element. If your theme or builder makes that hard, preload the background image so the browser fetches it at the start.
<section class="hero">
<img
src="/images/hero-1200.webp"
srcset="/images/hero-600.webp 600w, /images/hero-1200.webp 1200w, /images/hero-1800.webp 1800w"
sizes="100vw"
width="1200" height="600"
alt="Describe the hero image"
fetchpriority="high"
class="hero-img">
<div class="hero-content">...</div>
</section>.hero { position: relative; min-height: 600px; }
.hero-img {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
object-fit: cover;
z-index: -1;
}
.hero-content { position: relative; }<link rel="preload" as="image" href="/images/hero-1200.webp" fetchpriority="high"><link rel="preload" as="image"
href="/images/hero-1200.webp"
imagesrcset="/images/hero-600.webp 600w, /images/hero-1200.webp 1200w, /images/hero-1800.webp 1800w"
imagesizes="100vw"
fetchpriority="high">Use an image element in your builder
In Elementor, Divi or Gutenberg, replace the section's background image with an Image or Cover block where the theme allows it. The Gutenberg Cover block can output a real
<img>when you use its image (not a CSS background) and 'Fixed background' is off.Or add a preload in the head
Add the preload link through your theme's
header.php, a child theme, or a header-injection plugin. Load it only on the landing pages that need it.Check caching and optimisation plugins
If a plugin rewrites or lazy-loads backgrounds, exclude the hero from that setting and clear the cache.
Edit the theme section
In Online Store > Themes > Edit code, find the hero section file (often in
sections/). Output the image with theimage_tagfilter instead of a CSS background.Set priority
Use
image_tagwithloading: 'eager'andfetchpriority: 'high'for the hero image.
Do not fix this in GTM
A preload injected by a tag runs after GTM loads, which is too late to help. Put the preload in the page template instead.
Swap the background for an Image element
Add an Image element inside the section, set it to cover with object-fit in the Style panel, and place content above it.
Set loading to eager
In the Image settings, set Loading to Eager so it is not lazy-loaded.
Optional preload
Add a preload link in Page settings > Custom code > Inside head tag.
Prefer an Image element
In the funnel or website builder, place the hero as an Image element rather than a section background where your layout allows.
Add a preload
Add the preload link in the page's Tracking Code > Head Code section in page settings.
Use an image, not a strip background
Wix controls how its strips and backgrounds load. Where possible, place the hero as an Image element at the top of the page.
Compress the file
Upload a correctly sized image, since you have limited control over head tags on many Wix pages.
Use an image block or section image
Where your template allows, add the hero as an Image block rather than a section background.
Add a preload if you can
Add the link under Settings > Advanced > Code Injection > Header. It then loads on every page, so use it only if the same hero is used site-wide, and note Code Injection needs a plan that includes it.
Use img with fetchpriority
Render the hero as an
<img>withfetchpriority="high", explicit width and height, and noloading="lazy".Or preload in the head
Place the
<link rel="preload" as="image">early in<head>, before the stylesheet link.
Before
- Hero set with background-image in CSS
- Image request starts after the stylesheet is parsed
- LCP element is a div or section
- Large 'resource load delay' in DevTools
After
- Hero is an img tag or is preloaded
- Image request starts with the HTML
- LCP element is the img
- Resource load delay close to zero
How to confirm it's fixed
- View source: the hero file appears in an
<img>tag or a preload link in<head> - DevTools Network tab: the hero request starts at the same time as the CSS, not after it
- PageSpeed Insights shows the LCP element as the img, or shows the preload being used
- The 'resource load delay' phase is much smaller than before
- No second download of the same image under a different URL
- The hero still looks right on mobile and desktop widths
How to prevent it happening again
- Add 'hero is a real img with fetchpriority high' to your landing page template checklist
- Avoid page builder presets that set the first section's image as a background
- Re-run PageSpeed Insights on mobile after every theme, builder or plugin update
- When swapping the hero file, update any preload link to the new URL
- Keep a record of your normal LCP time so a rise stands out
How FunnelGuard handles this
FunnelGuard detects this issue only partly. Its scheduled checks measure the LCP time on your funnel steps, so you are alerted when a page gets slow. What it does not do is identify the cause: it cannot tell you that the slowness comes from a hero background set in CSS and discovered late.
Questions people ask
Why is my hero background image slow to load?
If the hero is set with CSS background-image, the browser only discovers it after downloading and parsing the stylesheet. The image request starts late, which delays Largest Contentful Paint. Using an <img> tag or a preload link lets it start immediately.
Does a CSS background image hurt LCP?
Yes, it can. Background images in CSS are not found by the browser's early HTML scan, so they start downloading later than an <img> tag would. If the background is your largest visible element, your LCP rises.
How do I preload a CSS background image?
Add <link rel="preload" as="image" href="/path/hero.webp" fetchpriority="high"> early in the <head>. The href must match the exact file the CSS requests. For responsive images, add imagesrcset and imagesizes attributes.
Should I use an img tag or a CSS background for a hero image?
Use an <img> tag when the hero is meaningful content and is above the fold, because the browser finds it early and you can set fetchpriority="high". Use CSS backgrounds for decorative images lower on the page.
How can I tell if my LCP element is a background image?
Run PageSpeed Insights and look at the 'Largest Contentful Paint element' in the diagnostics. If it shows a div or section rather than an img, a background image is likely. Chrome DevTools' Performance panel shows the same detail.
Can Elementor or Divi hero backgrounds cause slow LCP?
Yes. Page builders often set section images as CSS backgrounds, so they are found late. Replace the background with an image element where the builder allows it, or add a preload link for the hero file.
Does FunnelGuard tell me my hero is a CSS background?
No. FunnelGuard detects the LCP time on your funnel steps but not the cause. Use PageSpeed Insights or DevTools to see whether the LCP element is a CSS background, then apply the fix.
Related issues
- PRF-001LCP over 2.5 s on a funnel stepFix guide
- PRF-002LCP over 4 s on mobile (poor) on the paid landing pageFix guide
- PRF-008LCP image not preloaded / no fetchpriority=highFix guide
- PRF-009LCP image injected by JavaScript slider after loadFix guide
- PRF-005No srcset/sizes on responsive imagesFix guide
- PRF-024Images missing width/height causing late layout and slow LCPFix guide