Get rid of grey background in gallery image captions?

  • Unknown's avatar

    Hi,
    I just started customizing the CSS and was able to get rid of the overall background of the gallery images using:

    .entry-content .wp-block-gallery {
    background: none;

    }

    But I can’t get rid of the grey background that appears behind the caption text. I tried:

    .wp-caption {
    background: none;
    }

    But that didn’t work. Any tips? I’m pretty new to CSS. Thanks!

    Erica

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

  • Hi there,

    You can try the following CSS. Note that I added a slight text shadow to help the caption text be legible when against lighter backgrounds. They were hard to read without some kind of backing for added contrast.

    
    .wp-block-gallery .blocks-gallery-item figcaption {
        text-shadow: 1px 1px 2px #444;
        background: none;
    }
    

    Hope that helps. Please let us know if you have any more questions.

  • Unknown's avatar

    jerrysarcastic, thank you that worked perfectly, and the text shadow is a great call. much appreciated!

  • The topic ‘Get rid of grey background in gallery image captions?’ is closed to new replies.