#51294 closed defect (bug) (duplicate)
Image core block doesn't show the images properly
Reported by: | palfizsolt | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | major | Version: | 5.5.1 |
Component: | Editor | Keywords: | |
Focuses: | Cc: |
Description
In the editor the core image block shows the images correctly, but when it renders the photo on the target the aspect ratio is bad.
Steps to reproduce:
- Create a post and add an image block
- choose a big image from the media library
- see the preview of the new post, the image ratio will be bad
Reason of the issue:
The height html property is defined in the <img>, but the width property is overwritten with the wp-block-image style to max-width:100%.
Possible fix of the issue:
Remove the height and width property from the <img>
Note:
The issue is occurs only the image is linked from the media libary. There is no issue with external (URL) images. There was not this issue in the previous version of WordPress.
Change History (3)
Note: See
TracTickets for help on using
tickets.
I think this is being tracked in #50909.
Your theme is apparently not quite correct for responsive images, and needs
img {max-width:100%; height:auto;}
(several of the default themes do not have this CSS)