gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Justify image captions Left?

Open frodojrr opened this issue 8 years ago • 4 comments

Can't find this in the image block or any of the docs. I add a caption to an image, the text aligns centered. How can I get it to align to the left?

Thanks.

frodojrr avatar Aug 12 '18 19:08 frodojrr

You could either add a custom class to the image block (in the block settings panel: advanced > additional css classes) e.g add caption-align-left, and in your theme's stylesheet:

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

or override the default css for it to always align left

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

renrizzolo avatar Aug 13 '18 04:08 renrizzolo

There isn't a way to set the image caption's alignment in the image block itself, but as mentioned by @renrizzolo you could either set the captions in your theme to always align left, or create a custom CSS class in your theme that does this and apply it to your image block.

tofumatt avatar Aug 16 '18 21:08 tofumatt

If you haven’t changed your theme’s CSS properties then the default css property to change is: .wp-block-image figcaption { text-align: left; }

If you want step-by-step instructions on how to extract the tight CSS property then follow this Guide.

umair-mirza avatar May 12 '20 11:05 umair-mirza

Would this be the same for captions on tables? Alignment should work in the editor.

ghost avatar Apr 09 '21 16:04 ghost