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

fix: <img> aspect ratio w/ height: auto #2730

Merged
merged 1 commit into from
Jul 9, 2024
Merged

Conversation

Pinjasaur
Copy link
Contributor

Complement the max-width: 100% with a height: auto to preserve <img> aspect ratios, particularly when it's not wrapped in a block parent e.g. <p> or <figure> most commonly.

Related: https://www.smashingmagazine.com/2020/03/setting-height-width-images-important-again/

An example scenario that this fixes: https://reader.miniflux.app/share/8bd2c1ae6b6577ef9c81106964f9a9e9865edb0d

Before:

image

After:

image

Do you follow the guidelines?

Complement with `max-width: 100%` with a `height: auto` to preserve `<img>` aspect ratios, particularly when it's not wrapped in a block parent e.g. `<p>` or `<figure>` most commonly.

Related: https://www.smashingmagazine.com/2020/03/setting-height-width-images-important-again/
Copy link

@mfossen mfossen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've also run into this before

@fguillot fguillot merged commit 2fbe2df into miniflux:main Jul 9, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants