-
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
Images are centered in editor and aligned left in preview #31011
Comments
@TheMinimalistNinja I couldn't reproduce the issue, may I know which theme you are using? |
I use current latest Astra theme and current latest WP
|
I was able to repro here: |
The problem is known, but no solution has been added yet. I assume we can close your issue, as it is a duplicate of the one I linked to. |
Check out the PR here: #35787 An easy way to test the PR is following this method: https://make.wordpress.org/design/2021/03/03/testing-a-gutenberg-pull-request-pr/ |
Closing this out as a duplicate based on the above :) Let me know if this needs to be reopened though or if I'm missing something. |
Description
When I preview a post with WordPress images that are aligned center with the Gutenberg tool shows up as being aligned left in the preview.
Step-by-step reproduction instructions
Picture should align-center when align-center is selected in the editor
Actual behaviour
Picture aligns left in preview
This is the CSS rule which is causing the issue, which is located in https://www.theminimalistninja.com/wp-includes/css/dist/block-library/style.min.css:
.wp-block-image .aligncenter > figcaption, .wp-block-image .alignleft > figcaption, .wp-block-image .alignright > figcaption {
display: table-caption;
caption-side: bottom;
}
As a quick fix, I have added the below to my site via https://support.pipdig.co/articles/wordpress-how-to-add-or-edit-css/
.wp-block-image .aligncenter > figcaption {
display: block !important;
}
After removing this, the image appears in the center - https://pip.click/16189096817.png
WordPress information
Device information
The text was updated successfully, but these errors were encountered: