how to center an image in wordpress 5.1

  • Unknown's avatar

    Is there an easy way to horizontally center an image in WordPress 5.1? I don’t see a setting to manage this, but maybe I’m not looking in the right place. I don’t see a way to do it with image settings (on the block settings tab), which seems like where it should be.

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Hi @kaseyheinly,

    Once you upload the image on your post, you can click on it and a popup will appear with different options where you can edit the alignment, the size, and the caption. Please take a look at this guide.

    Have a nice day!

  • Unknown's avatar

    Hmmmm. I don’t see a pop-up when I click the image in a post. I see a menu bar at the top of the screen which shows three alignment options when an image is selected – one showing an image at left with text to the right, one with an image centered and text above and below, and one with the image at right and text at left.

    When I select the second option, which shows the image centered with text above and below, it displays left-aligned in the post after it’s published. See the amazon and goodreads images in this post:

    http://thestorysanctuary.com/review-within-these-lines-by-stephanie-morrill/

    Is this a bug or is there another place to change the alignment?

  • Unknown's avatar

    Hi @kaseyheinly,

    I see a rule in your theme’s CSS making the figure element to display as a block instead of a table which prevents the aligning of the image. Adding this custom CSS should help resolve the issue.

    #content .wp-block-image .aligncenter {
       display: table !important;
    }

    Let me know if that helps.

  • Unknown's avatar

    Amazing! Yep – it works now. Thanks so much for your help. :)

  • Unknown's avatar

    You are very welcome! Glad it worked out well :)

  • The topic ‘how to center an image in wordpress 5.1’ is closed to new replies.