The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Use loading="lazy" on images that are below the initial viewport, and leave your likely Largest Contentful Paint (LCP) image eager. Give every image real intrinsic dimensions, preserve useful alternative text, and treat fetchpriority as a separate, occasional scheduling hint. Lazy loading is browser-controlled deferral—not a fixed pixel rule or a guaranteed speed percentage.
What image lazy loading does
The HTML Living Standard defines loading as an enumerated attribute. Its lazy state tells the browser that fetching may be deferred until the resource is sufficiently close to being needed. The browser chooses when that happens using its own conditions; there is no universal author-controlled distance threshold.
eager requests immediate loading. It is also the missing-value and invalid-value default, so an image without a valid loading value behaves eagerly.
Lazy loading can save network bytes, decoding work and contention when a visitor never scrolls to an image. It can also hurt the experience if an image expected immediately is delayed. Results vary with layout, image importance, network conditions and browser scheduling.
#1 Best Overall
- Brand: Wiley
- Set of 2 Volumes
- A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
The correct HTML pattern
<img
src="gallery-image.jpg"
alt="A red kite flying over the beach"
width="1200"
height="800"
loading="lazy"
>
Put loading="lazy" on the img element itself, including when the element is nested in a picture. Use the image’s real intrinsic dimensions, or reserve the same aspect ratio with CSS. Responsive rules can still scale the rendered image:
.card-image {
width: 100%;
height: auto;
display: block;
}
The width and height attributes communicate the aspect ratio before the file arrives. They do not force the image to render at that physical size when CSS makes it responsive.
Which images should be lazy-loaded?
Use lazy loading for noncritical content
- Images below the fold in articles, galleries and product grids.
- Images in tabs, accordions or carousels that are not initially visible.
- Decorative or supplemental artwork that a visitor may never reach.
These are good candidates because deferral can prevent downloads that never contribute to the visit and leaves the initial network more available for HTML, CSS, fonts and critical media.
Keep initial-viewport and LCP images eager
Do not blanket every image with loading="lazy". A hero image, article lead image or prominent product photo visible at the start is often the LCP candidate. Delaying it can postpone discovery and make the page feel slower.
<!-- Likely LCP image: do not defer it -->
<img
src="hero-1600.jpg"
alt="A mountain trail at sunrise"
width="1600"
height="900"
loading="eager"
>
<!-- Below the fold: defer it -->
<img
src="trail-map.jpg"
alt="Map of the mountain trail"
width="1200"
height="800"
loading="lazy"
>
“Above the fold” is not a permanent coordinate: viewport size, responsive layout and content order differ by device. Decide from the likely first viewport and whether the image is needed for the page’s primary task, not from a blanket rule.
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
Prevent layout shift with dimensions
An unloaded image with no known size can occupy little or no space. When it arrives, surrounding text and controls move. That movement is especially visible with lazy images because the file is intentionally absent during the initial layout.
Always provide both dimensions when practical:
<img
src="team.jpg"
alt="The engineering team standing outside the office"
width="1200"
height="675"
loading="lazy"
>
If your rendering system cannot emit attributes, reserve the equivalent ratio in CSS:
.media-frame {
aspect-ratio: 16 / 9;
overflow: hidden;
}
.media-frame img {
width: 100%;
height: 100%;
object-fit: cover;
}
Do not invent arbitrary dimensions. Derive them from the source asset (or the intended crop) so the reserved ratio matches the eventual image.
Accessibility still applies
Lazy loading changes fetch timing, not the image’s meaning. Meaningful images need concise, useful alt text. Decorative images should use an empty alternative, alt="", so assistive technology does not announce irrelevant content.
<!-- Informative image -->
<img src="chart.png" alt="Revenue increased from Q1 to Q4" width="1000" height="600" loading="lazy">
<!-- Decorative image -->
<img src="swirl.svg" alt="" width="240" height="80" loading="lazy">
If an image cannot be seen or fails to load, its alternative text remains the way many users receive its purpose. Never remove or weaken alt because an image is deferred.
fetchpriority, decoding and preload
fetchpriority is a separate hint
fetchpriority="high" can signal greater relative importance; low can reduce relative priority. It does not replace the eager-versus-lazy decision. Apply it selectively to a genuinely important image when measurements or clear page structure justify it:
<img
src="hero.jpg"
alt="A city skyline at dawn"
width="1600"
height="900"
loading="eager"
fetchpriority="high"
>
Adding high priority to many images defeats the purpose of prioritization and can compete with more important requests. An accurate loading="lazy" choice remains necessary.
decoding controls decoding preference
decoding="async", sync and auto express decoding preferences. Decoding is separate from fetch deferral; it is not a substitute for choosing loading.
When preload is appropriate
Preload can complement a genuinely critical image whose discovery would otherwise be late. It should not be used to force every image into the critical path. If the image is not needed initially, lazy loading is usually the more accurate signal.
How browser behavior affects your code
The browser decides the threshold
Because user agents choose when a lazy resource is close enough, code must not depend on a fixed number of pixels. Layout changes, viewport dimensions, connection conditions and browser heuristics can alter when a request starts.
Rank #4
Disabled scripting changes behavior
MDN documents that browsers do not perform native lazy loading when scripting is disabled, partly to avoid exposing scroll-position information. In that situation, images load eagerly. Your HTML should therefore remain correct and usable without assuming lazy deferral always occurs.
Free tools Windows power users keep installed
One-click scans. No signup required.
The load event is not an image-readiness signal
A page’s load event may fire while lazy images remain unfetched or incomplete. If application logic depends on one image, observe that element:
const image = document.querySelector('#report-image');
function imageReady() {
// Safe to use the image here.
console.log(image.naturalWidth, image.naturalHeight);
}
if (image.complete) {
imageReady();
} else {
image.addEventListener('load', imageReady, { once: true });
image.addEventListener('error', () => {
console.error('Report image failed to load');
}, { once: true });
}
A repeatable implementation workflow
- Inventory images. Mark which are visible in the first viewport, likely LCP candidates, below the fold or conditionally shown.
- Set loading mode. Leave critical initial images eager; add
loading="lazy"to noncritical images. - Reserve space. Emit accurate
widthandheightattributes, or an equivalentaspect-ratio. - Write alternatives. Use descriptive
alttext for informative images andalt=""for decoration. - Review priority hints. Add
fetchpriorityonly where relative importance is clear; do not use it as a replacement for loading mode. - Test real paths. Check a narrow and wide viewport, slow connections, keyboard navigation, scripting disabled, long pages and images that fail.
- Measure the result. Confirm that the LCP image is discovered promptly, below-fold images are deferred when appropriate, and no content jumps when images arrive.
Common mistakes and fixes
| Symptom | Likely cause | Fix |
|---|---|---|
| The hero appears late | The initial image was marked lazy | Remove loading="lazy"; keep it eager and consider a narrowly justified high priority hint. |
| Text jumps as images load | No intrinsic dimensions or aspect-ratio reservation | Add accurate width/height or reserve the correct CSS ratio. |
| Every image downloads immediately | Images use the default eager behavior, or scripting is disabled | Apply loading="lazy" to eligible offscreen images; understand that disabled scripting can make browsers load eagerly. |
| Code runs before a specific image is usable | Reliance on the page load event |
Check that element’s complete state and listen for its own load/error events. |
| Assistive technology gets no image meaning | Missing or meaningless alt |
Restore concise alternative text, or use an empty value only for decoration. |
| Network contention remains high | Too many images are eager or marked high priority | Defer genuinely noncritical images and reserve high priority for the most important request. |
Performance, reliability and cost considerations
Native lazy loading requires no JavaScript library, license or image proxy. Its benefit is conditional: fewer bytes and less work when deferred images are never reached, balanced against the risk of delaying content a visitor expects. Evaluate both outcomes rather than promising a universal percentage improvement.
Image compression, modern formats, responsive sources and a fast delivery path still matter. Lazy loading decides when to fetch; it does not reduce the bytes in an image that is eventually downloaded. Keep your markup resilient if a request fails, and provide meaningful alternatives for users who cannot receive the bitmap.
Or skip the browser setup
If you need rendered screenshots for documentation, QA or visual checks instead of implementing browser-side capture, ScreenshotNeo returns a PNG, JPEG, WebP or PDF from one request. Its cleaner capture accepts consent banners before the shot and removes more than 60 known consent platforms, newsletter popups and chat widgets; each step can be disabled. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and response headers identify the page verdict and billing status.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errorsFor a direct request, see the ScreenshotNeo API documentation:
Best Value
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Python:
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)
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 also offers an MCP server with take_screenshot, get_page_info and capture_pdf tools for Claude, Cursor and other MCP clients. Every plan includes its features; the Free plan provides 1,000 shots each month without a card, and paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.
FAQ
Is lazy loading supported inside picture?
Yes. Keep the loading attribute on the selected img element inside the picture element.
Can I force a browser to fetch a lazy image at an exact scroll distance?
No. Native lazy loading leaves that threshold to the user agent. Design correct eager and lazy states without depending on a universal distance.
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 reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteShould a decorative image have descriptive alt text?
No. When it conveys no information, use alt=""; reserve descriptive text for images that communicate meaning.
Frequently Asked Questions
Is lazy loading supported inside picture?
Yes. Keep the loading attribute on the selected img element inside the picture element.
Can I force a browser to fetch a lazy image at an exact scroll distance?
No. Native lazy loading leaves that threshold to the user agent.
Should a decorative image have descriptive alt text?
No. Use alt="" when the image conveys no information.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Quick Recap
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.




