Opened 5 years ago
Closed 5 years ago
#49793 closed defect (bug) (fixed)
Twenty Twenty: Images in list blocks are not positioned correctly
Reported by: | poena | Owned by: | ianbelanger |
---|---|---|---|
Milestone: | 5.4.2 | Priority: | normal |
Severity: | normal | Version: | 5.3 |
Component: | Bundled Theme | Keywords: | needs-testing has-patch commit fixed-major |
Focuses: | css | Cc: |
Description
Images inside lists blocks looks like they are above the list item.
They are not aligned with other types of list content.
Add a new list block in the editor.
Add an inline image using the button in the toolbar.
Add some text next to the image.
Save and view the list on the front.
In the editor, the content is aligned nicely next to each other.
But on the front the image is not inline, but looks like it is above the list.
-If the image is the only content in the list, it looks better, the image sits in place next to the bullet.
Attachments (4)
Change History (15)
#1
@
5 years ago
- Focuses css added
- Keywords needs-testing needs-patch added
- Milestone changed from Awaiting Review to 5.5
- Version set to 5.3
#2
in reply to:
↑ description
@
5 years ago
Hi Poena, I looked into the issue and I think a class like "wp-list-block-image-inline" or "wp-image-inline" must be added to the <img>
tag. And then overwriting the default IMG styling will be a better option.
Replying to poena:
Images inside lists blocks looks like they are above the list item.
They are not aligned with other types of list content.
Add a new list block in the editor.
Add an inline image using the button in the toolbar.
Add some text next to the image.
Save and view the list on the front.
In the editor, the content is aligned nicely next to each other.
But on the front the image is not inline, but looks like it is above the list.
-If the image is the only content in the list, it looks better, the image sits in place next to the bullet.
#3
follow-up:
↓ 4
@
5 years ago
It is the display:block here (instead of inline) that is causing the problem.
But removing that now may cause other problems elsewhere, so we need to add display inline or display inline block for images in lists specifically.
style.css line 624.
svg, img, embed, object { display: block; height: auto; max-width: 100%; }
Adding new class names, if preferred, is something that would need to be done in Gutenberg.
#4
in reply to:
↑ 3
@
5 years ago
Actually you are right. And I checked it again if other themes are getting the same problem, but it seems display: block;
is only written in Twenty Twenty theme style and other themes are working properly.
So I believe there is no need to add a separate class in Gutenberg. I am going ahead and adding the following code in style.css
of Twenty Twenty theme. This should resolve the issue.
.entry-content li img{ display: inline-block; }
Kindly let me know if there are any changes.
Replying to poena:
It is the display:block here (instead of inline) that is causing the problem.
But removing that now may cause other problems elsewhere, so we need to add display inline or display inline block for images in lists specifically.
style.css line 624.
svg, img, embed, object { display: block; height: auto; max-width: 100%; }Adding new class names, if preferred, is something that would need to be done in Gutenberg.
#6
@
5 years ago
The patch works for me... now shows the same in the front and editor. :) thanks @mayankmajeji
This ticket was mentioned in Slack in #core-test by javier. View the logs.
5 years ago
#8
@
5 years ago
- Keywords commit added
- Owner set to ianbelanger
- Status changed from new to reviewing
List block class add