-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] cumulative layout shift issue #279
Comments
Hey @teoh4770, what do you mean by this? |
article about cumulative layout shift: https://web.dev/articles/cls |
The most common causes of a poor CLS are the following:
|
Link: A more elegant and easier to use solution solution: <style>
img {
width: 100%;
height: auto;
aspect-ratio: attr(width) / attr(height);
}
</style>
<img src="hero_image.jpg" alt="" width="500" height="500"> Basically, this solution means if the following four conditions are true,
then the correct image dimensions could be calculated without needing to wait for the images to download, and so without the need of a content layout shift: |
No description provided.
The text was updated successfully, but these errors were encountered: