Skip to content
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

Images get distorted due to img { max-width: 100%; } without height: auto; #196

Open
NoNoNo opened this issue Jul 24, 2023 · 0 comments
Open

Comments

@NoNoNo
Copy link

NoNoNo commented Jul 24, 2023

img {
max-width: 100%;
}

Without height: auto the aspect ratio will change for images with width > 100%, resulting in a distorted image.

https://www.smashingmagazine.com/2020/03/setting-height-width-images-important-again/#how-css-interacts-with-element-widths-and-heights

@NoNoNo NoNoNo changed the title Images get distorted due to 'img { max-width: 100%; } without height: auto;` Images get distorted due to img { max-width: 100%; } without height: auto; Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant