Skip to content

queseri/responsive-img

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Responsive images

Lighthouse issue - Image elements do not have explicit width and height

  • when an image is inserted in the html as in the following from the index.html <img src="./assets/image-hero.webp" alt="" class="img" />, Lighthouse indicates that an Image elements do not have explicit width and height. A link for further details to the reasons why the sizes are important is given Images without dimensions #. The main reason behind this approach is to allow browsers to reserve the correct amount of space in the document whilst the image is loading
  • the illustration is done using display: flex where the mobile has a column direction which is changed to row in medium to desktop. Mobile at 375px - lighthouse image without explicit sizes warning Mobile at 375px - img has no explicit sizes set - devtools open Tablet at 900px - image has no explicit sizes

Mobile at 375px - image has explicit sizes Tablet at 900px - image has explicit sizes Desktop - image has explicit sizes

image without sizes video demostration image with sizes video demo

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published