Site logo

Archived topic

Custom CSS Class To Remove Image Border

3 replies · Started by Oliver on February 12, 2021

Viewing posts 1–4 of 4

Hi there!

I'm applying a rounded black border to my images:

#page img {
border: 1px solid #000000;
border-radius: 10px;
}

This works, but now I need to remove that border from some images (diagrams). I thought I could create a special class called "no-border-image" and add it to the images.

I tried adding this to my child theme:

.no-border-image {
border: 1px solid #ffffff;
border-radius: 10px;
}

It doesn't work. Any idea what would, please?

Thanks,
Oliver

Hi Oliver,

Try this instead:

#page .no-border-image img {
    border: 0px;
}

Hi Ying,

Works like a charm, thanks!

You are welcome :)

This archived topic is closed to new replies.