In this tutorial we are going to discuss the simple but crucial issue that web masters, and SEO people come across while working with images on a web page.
The issue raises when a web developer, SEO guy checks page performance at Lighthouse, here, https://pagespeed.web.dev/ one might see an error causing low scores for the page SEO, with flag, “Displays images with incorrect aspect ratio.”
Now the answer to the question on “How to get rid of this red flag raised by Lighthouse page test”, here:
Set the actual size of image on your page in the <img> tag of HTML, here's an example, we are using a image with dimensions, width="640" and height="853" so what page speed test wants you to apply is that you give the exact dimensions of your image to the width and height properties of img tag. <amp-img data-hero src="img.webp" alt="img" layout="responsive" width="640" height="853" srcset="img.webp 640w" class="img" > </amp-img>
This would surely get rid of the issue raised with Lighthouse page test, as far as image incorrect aspect ratio is concerned.
Few best practice we use in our code are, using amp service, for displaying images.
Use improved stylesheet with width 100% and keep height auto, and if this does not work we apply fixed sizes for width and height is usually left auto.
Here's one pro+ tip for beginners and web masters out there, we give images slight curved edges with border-radius; this is simple but elegant stylesheet element for us. Thanks for reading hope this helps, if you got queries, feel we've made mistakes, or have more correct answer to this issue kindly create your HilalSocial profile and DM us right away, or post at our platform. We will include your post or DM to this page.
Major companies behind, Flying cars, air taxies, eVTOLs all you need to know.
“Cars that fly, a dream of mankind since many generations, that involves vertical take-off and landing of cars, to scape the traffic, feel the breeze, drive into the clouds.”
2024-07-26 05:45:04
Sanity.io all you need to know. Key Features, Use Cases, of Sanity.io.
Key Features of Sanity.io:
2024-08-22 00:00:00
Apple to launch iPhone 16 next month.
Apple to launch iPhone 16 next month. An thin iPhone "air" is rumoured to be introduced with a single camera and less features.
2024-08-28 21:15:00
Turksat 6A Turkish homemade satellite in space.
Turksat 6A all you need to know | Over 80% of Turksat 6A, was manufactured in Turkey.
2024-08-27 21:22:27
Multicore CPUs Explained: A Comprehensive Guide. | What to pick?
The Powerhouse Behind Modern Computing: powerful processor! | How to choose the right CPU for your desktop or laptop in 2024?
2024-07-26 05:25:30
Is Vercel, Next.JS good option for news website?
Other platforms like next.js for Content Website, Blogs, News Website?
2024-08-20 15:52:31
Apple to launch iPhone 16 next month.
Apple to launch iPhone 16 next month. An thin iPhone air to be introduced with a single camera and less features: Reports online.
2024-08-28 21:43:15
China has established world's first 6G field test network | 6G network?
China first leaded in the 5G network, and now successful implementation of a 6G field test network, makes the country a leader in next-generation wireless communication as well. China was behind in the 2G, 3G and 4G, network race but became a global leade
2024-07-22 04:01:29
Cars Full Automation? Self-driving cars present & future?
Driverless cars? | AI driven automobile in India, US, China, UK? | 5 automation stages?
2024-09-14 17:00:55
Get rid of “Displays images with incorrect aspect ratio”
2024-10-31 22:59:10
Mukesh Ambani is the Asia's richest person.
Asia's richest persons in 2024. Gautam Adani or Mukesh Ambani who is the richest in India?
2024-10-25 01:22:48
TikTok challenges a US bill in court, that could ban it.
TikTok challenge in court against law that could result in it being sold or banned in US.
2024-09-21 14:12:27
Check this month gyarvi sharif date
11vi sharif date 2025 | badi gyarvi sharif date this month
2024-09-17 13:12:44
Pakistan discovers Massive oil, gas reserves in its waters.
Pakistan found huge oil and gas reserves. | Pakistan to become world's 4th largest in terms of Oil reserves?
2024-09-11 19:16:07
iOS 18 AI features on iPhone 16 not available in India (English)
iOS 18 AI features availability in India? India (English) support not coming soon for Indian iPhone users.
2024-09-09 18:18:42
इलेक्ट्रिक गाड़ियाँ 2030 तक हमारे जीवन का एक अहम हिस्सा बन जाएंगी?
इलेक्ट्रिक गाड़ियाँ 2030 तक हमारे जीवन का एक अहम हिस्सा बन जाएंगी?
2024-09-06 20:35:39
इलेक्ट्रिक गाड़ियाँ 2030 तक हमारे जीवन का एक अहम हिस्सा बन जाएंगी?
इलेक्ट्रिक गाड़ियाँ 2030 तक हमारे जीवन का एक अहम हिस्सा बन जाएंगी?
2024-09-06 20:16:06
5G and 6G speed, difference. Their impact on our world?
China is leading in 6G development | India has started its 5G networks
2024-09-04 19:49:35
Hezbollah fired 300+ rockets at Israel in 1st phase retaliation.
Hezbollah fired 300+ rockets at Israel in 1st phase retaliation, after Israel assassinated Faud Shukr in Lebanon last month.
2024-08-28 21:08:52