Uploaded November 2026 | Updated November 2026, 4 days ago
Fix the "Lazy-loaded images should have explicit dimensions" warning in Google Chrome DevTools / Lighthouse audit reports. Learn why modern browsers require width and height attributes or CSS aspect-ratio on lazy-loaded images to prevent Cumulative Layout Shift (CLS) and improve Core Web Vitals performance scores.
NOTE: If the website you are testing does have width and height defined, then, ignore this message. First check source code CTRL+U
Step-by-Step Instructions
Locate the Warning in Chrome DevTools
Action: Open your webpage in Google Chrome, right-click anywhere, select Inspect, and navigate to the Lighthouse or Performance tab to run a web performance audit.
Verification: Identify the flagged IMG elements listed under the diagnostics section for lazy-loaded images lacking explicit dimensions.
Add Explicit Width and Height Attributes
Action: Open your HTML source code or template files (such as WordPress PHP templates), locate the flagged IMG TAGS, and explicitly add the width and height attribute values matching the intrinsic aspect ratio of the image files.
Example:
img src="image.jpg" alt="Example" width="800" height="600" loading="lazy"
Verification: Save your code changes, refresh the browser, and re-run the DevTools audit to confirm the warning is resolved.
Alternative: Apply CSS Aspect-Ratio
Action: If your images are fully responsive using CSS (e.g., set to width: 100% with auto height), apply a matching CSS aspect-ratio property to the image selector in your stylesheet.
Example: img { aspect-ratio: 16 / 9; width: 100%; height: auto; }
Verification: Check that the browser reserves the correct layout space before the image loads, preventing layout shifts on the page.
🔔 Subscribe to @RankYa for more how-to tutorials related to Agentic Optimization, WordPress, Shopify, Search Console, Google Account Management.
Fix the "Lazy-loaded images should have explicit dimensions" warning in Google Chrome DevTools / Lighthouse audit reports. Learn why modern browsers require width and height attributes or CSS aspect-ratio on lazy-loaded images to prevent Cumulative Layout Shift (CLS) and improve Core Web Vitals performance scores.
NOTE: If the website you are testing does have width and height defined, then, ignore this message. First check source code CTRL+U
Step-by-Step Instructions
Locate the Warning in Chrome DevTools
Action: Open your webpage in Google Chrome, right-click anywhere, select Inspect, and navigate to the Lighthouse or Performance tab to run a web performance audit.
Verification: Identify the flagged IMG elements listed under the diagnostics section for lazy-loaded images lacking explicit dimensions.
Add Explicit Width and Height Attributes
Action: Open your HTML source code or template files (such as WordPress PHP templates), locate the flagged IMG TAGS, and explicitly add the width and height attribute values matching the intrinsic aspect ratio of the image files.
Example:
img src="image.jpg" alt="Example" width="800" height="600" loading="lazy"
Verification: Save your code changes, refresh the browser, and re-run the DevTools audit to confirm the warning is resolved.
Alternative: Apply CSS Aspect-Ratio
Action: If your images are fully responsive using CSS (e.g., set to width: 100% with auto height), apply a matching CSS aspect-ratio property to the image selector in your stylesheet.
Example: img { aspect-ratio: 16 / 9; width: 100%; height: auto; }
Verification: Check that the browser reserves the correct layout space before the image loads, preventing layout shifts on the page.
🔔 Subscribe to @RankYa for more how-to tutorials related to Agentic Optimization, WordPress, Shopify, Search Console, Google Account Management.










![How-to Setup Cross Domain Tracking GA4 (Quick and Easy)
Setting up cross-domain tracking in Google Analytics 4 (GA4) allows you to see the journey of a user across multiple related websites as a single session.
Step 1 make sure all domains you want to track are using the same GA4 Measurement ID.
Step-by-Step Configuration
Heres how to configure cross-domain tracking within your GA4 property:
Navigate to Admin: In your Google Analytics 4 account, click on the Admin gear icon in the bottom-left corner.
Select Data Stream: In the Property column, click on Data Streams and then select the web data stream you want to configure.
Configure Tag Settings: Scroll down and click on Configure tag settings.
Configure Your Domains: Under the Settings section, click on Configure your domains.
Add Domains: In the Include domains that match the following conditions section, click Add condition.
Enter the first domain you want to track (e.g., example.com).
Click Add condition again to add the next domain (e.g., shoppingcart.com).
Continue this process until youve added all the domains you want to track in this cross-domain setup.
Learn more about [GA4] Set up cross-domain measurement here:
https://support.google.com/analytics/answer/10071811 How-to Setup Cross Domain Tracking GA4 (Quick and Easy)](https://i.ytimg.com/vi/oP-P2LJaMAs/mqdefault.jpg)