Download
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

Caption not centred on image which is

  • #11586
    Avatar photo[anonymous]

    I have placed an image into a post and set the property to be centered and show caption. In the editor the image is centred, as is the caption, but when I publish the site, the image remains centred and the caption is left aligned.

    I want both the image and the caption to be centred.

    Looking at the HTML, the image has a <img class=”post__image post__image–center”… but the caption has nothing to indicate that it should be centred (and is outside the scope of the image tag).

    I’m new to getPublii, so it could be user error…

    #11606
    Avatar photo[anonymous]

    Which theme are you using?

    #11610
    Avatar photo[anonymous]

    The Theme is Editorial-2 (v.1.4.0.0)

    https://marketplace.getpublii.com/themes/editorial-2/

    #11613
    Avatar photo[anonymous]

    From post list screen go to tools and plugins

    Than click on “custom CSS”

    Editorial_2

    And add this CCS:

    figcaption {
        text-align: center;
    }

    Editorial_3

    Now the caption should be centered.

    If you want it to be closer to the image, add some negative margin-top:

    figcaption {
        text-align: center;
        margin-top: -2rem;
    }
    #11616
    Avatar photo[anonymous]

    Thanks, that works.

    I’d hoped that it would inherit from the image’s alignment (or ideally have a class of its own), but I can work with this.