Site logo

Archived topic

Link Style - how to remove underline in pictures

5 replies · Started by Jose on September 17, 2020

Viewing posts 1–6 of 6

Hi,

I'm using this custom CSS to underline links in the content. It works perfectly.

.entry-content a {
    border-bottom: 2px solid #1e73be;
} 

However, the images that are linked to a bigger version of themselves have now the image underlined
Any way to apply this underline to only the text in the content?

Thank you

Hi,

Can you provide us a link to your site to take a closer look?

It'll help a lot as we can see the page to identify the most suitable CSS selector to apply your styling.

Thanks.

Perhaps this CSS code is the better approach as this only targets texts regardless of what's inside the anchor links tag.

.entry-content a {
    text-decoration: underline;
}

But if you really prefer the border-bottom approach, you can exclude the links with images inside by trying this.

figure.wp-block-image > a {
    border: none;
}

Let us know if it works for you.

it works perfectly

thank you Elvin

Nice one.

No problem.:)

This archived topic is closed to new replies.