Site logo

Archived topic

Background color for specif image

3 replies · Started by June on October 3, 2021

Viewing posts 1–4 of 4

Hi, I have an image container in the page hero for which I have applied a background color but it is applied to all the images. I want the background color for only the page hero image container.
Please help me figure out.

Hi there,

Select the Container Block that the hero image sits in, and in Advanced > Additional CSS Class(es) add a custom class eg. has-hero-image

Then update your CSS to:

.gb-container.has-hero-image .wp-block-image img {
    border-radius: 10px;
    background-color: #0ef096;
    box-shadow: none;
}

Perfect! Thank you so much, David.

Glad to be of help

This archived topic is closed to new replies.