-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Using width: 100% on img causes problems #17787
Comments
@joyously I can't confirm with you. I think your theme causing the issue. |
Well, I get the same result regardless of theme, because the offending rule is in the block library styles loaded on the front end, not in the theme. I think it's more that the test image is portrait and not very wide, than it is not very wide. By using a width of 100% on a narrow image, the height is accentuated ( |
Is there a block style with the |
Yes, but it still is a problem. There is no reason to use width:100% on images and good reason to not use it. |
I am having the same issue regardless of the theme. When image is set to 100%, it overflows outside the container. |
This bug still exists in GB 7.0.0. |
@joyously a lot of bugs still exists in GB 7.0 ... we'll have to wait a while to fix all these bugs :-) |
Thank you Adam! |
I tested briefly with videos and agree this deserves closer scrutiny, especially if someone is familiar with the original purpose of the style.
That is unfortunate, I wonder how we can make this more straightforward to test? Over on the Site Kit project, we added a GitHub action that builds a zip of the plugin for every PR. This along with a tester plugin lets you easily test the plugin code from any in progress PR. I wonder if we can add something like that to Gutenberg? |
I was able to open the PR using gutenberg.run |
FWIW, as of #26746, we're already building Gutenberg for every PR. @paaljoachim has pointed out that we need to make those builds more visible. |
@paaljoachim Fantastic! Would love to see this link added automatically to every PR so it easier for testers like Joy to discover. |
And, I see that exactly requested here: #27426 |
When I click the .run link provided, it sits on "Redirecting" for a long time. I have no idea what it's doing. |
It's a setting called "Crop image to fill entire column", under "Media & test settings" in the sidebar. I checked and removing |
From discussion in #28822 and #28922, it appears aspects of the original issue are no longer relevant and that the solutions discussed may have unintended consequences for the Media & Text block. For that reason, I'm closing this one. We can always open new tickets if adjacent issues surface or resurface. Thank you. |
I think the relevant comment was
But you only did half (closing this one). Can you reference the other issue where the size setting is impacted? |
Whoops, I let that one slip! Here it is: #29362 |
Thank you. |
A style is making my image too big.
Using WP 5.3 beta2
A media-text block with a small image is stretched, making the image blurry and out of position.
The problematic CSS is (found in wp-includes/css/dist/block-library/style.min.css?ver=5.3-beta2-46391)
To reproduce
Steps to reproduce the behavior:
Expected behavior
I expect the images to show at no larger than the original.
Screenshots

This is how it looks in the editor. The images look stretched if I use a wide window.
This is the front end.

This is the front end when I disable the

width: 100%
rule mentioned above.Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: