Site logo

Archived topic

Editing gallery captions

3 replies · Started by Joey on August 18, 2020

Viewing posts 1–4 of 4

I have my captions modified with the CSS below but it only affects captions to regular images, not the gallery caption.

.wp-block-image figcaption {
    padding-right: 10px; 
	padding-left: 5px;
	text-align: right;
        font-size: 15px;
	font-style: italic;
	color: grey;	 
}

I don't care about the captions inside the images of the gallery, just the caption below the entire gallery, where it says "Book covers from Dune, the Hobbit, and The Stand." on the last gallery of my page. I tried .wc-gallery .gallery-caption but no effect. Looks weird when some captions are styled and some aren't. Thank you.

Hi there,

Try adding this CSS as well:

figcaption.blocks-gallery-caption {
    padding-right: 10px;
    padding-left: 5px;
    font-size: 15px;
    font-style: italic;
    color: grey;
    margin-left: auto;
}

That's weird how text-align: right; doesn't work and you have to margin-left: auto

It works well, thanks a lot for your help and for replying so quickly.

No problem :)

This archived topic is closed to new replies.