Skip to content

Silvioen/Images-without-dimensions---Image-elements-have-no-explicit-width-and-height

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Images without dimensions

One of the most CLS (Cumulative Layout Shift) Problem is "Image elements have no explicit width and height"

Summary

Always include width and height size attributes on your images and video elements. Alternatively, reserve the required space with CSS aspect ratio boxes. This approach ensures that the browser can allocate the correct amount of space in the document while the image is loading.

Solution

With this simpel sVanilia JavaScript all images add the attribut width and height of this Image at DOMContentLoaded

Authors

🚀 About Me 🚀 Silvio Endruhn | Mediadesigner

Creating professional websites according to the latest standards is my craft. I design individual layouts according to the ideas of my customers or bring the outdated site up to date.

My services include (almost) everything that has to do with WordPress. Consulting & conception, theme design, complete website build, theme customizations, performance optimization, WordPress maintenance and updates.

Other services are in the area of frontend development, besides HTML, CSS and JavaScript, I offer services for Vue.js, React, TypeScript, Node.js and many other frontend technologies.

Services in the area of SEO and SEA can also be booked with me, starting with keyword analysis, technical SEO, landing pages and my own Merchant Center.

🔗 Links

portfolio linkedin twitter

Badges

MIT License

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published