[Resolved] Can you centre caption text for image blocks?

Home Forums Support Can you centre caption text for image blocks?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1311821
    Joseph

    Hello,

    We’re just getting ready to relaunch our site tomorrow but there’s one thing I can’t figure out: How to centre the caption text for images.

    When I’m writing the page/post the caption appears centred under the image but as soon as I click preview or publish it becomes left aligned and the only text options I see for the caption text are Bold, Italics, or Link and the “More” dropdown menu only has Inline Code, Inline Image, Strikethrough and Text Colour. I can centre the images but not the caption.

    I’ve linked to a specific page illustrating the left align captions…

    Thanks,

    Joseph

    #1311867
    Leo
    Staff
    Customer Support

    Hi there,

    Try this CSS:

    .wp-block-image figcaption {
        text-align: center;
    }

    Adding CSS: https://docs.generatepress.com/article/adding-css/

    Let me know if this helps 🙂

    #1312438
    Joseph

    Hi Leo,

    Thanks. Works perfectly. I simply added it as “additional css” since I want to keep plugins to a bare minimum and have no intention of switching themes. I like you folks. 🙂

    #1312812
    Leo
    Staff
    Customer Support
    #1426808
    Michele

    I’m using this, and it works for captions under images and the individual images in a gallery.

    .wp-block-image figcaption {
        font-size: .8em;
        margin-top: .25em;
        margin-bottom: 1.25em;
        text-align: center;
        }

    However, I cannot seem to center align the caption that appears under an entire gallery.

    #1426818
    Leo
    Staff
    Customer Support

    Any chance you can open a new topic and link us to the page in question?

    Thanks 🙂

    #1426821
    Michele

    Will do…

    #1426824
    Leo
    Staff
    Customer Support
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.