Underline links but not buttons

I’d like the links in my text to be underlined, and adding this code to the Additional CSS accomplishes it:

    .entry-content a {
        text-decoration: underline;
    	/*for link underlining*/
    }

However, now the links in buttons are underlined too. I can add this code to remove the underline in buttons:

    body div a:visited,
    body div a:link,
    body div a:hover,
    body div a:active {
        text-decoration: none;
    	/*to erase underline in buttons*/
    }

but then the text links aren’t underlined any more. Is there a way to have text links underlined but button links not underlined?

Hello there,

Try this code:

    .entry-content a:not(.comment-reply-link):not(.button):not(.roll-button):not(.elementor-button) {
      text-decoration: underline;
    }

Regards,
Kharis

That didn’t work - link text in buttons is still underlined

Hello there,

Please share a link to your site here, so I can take a closer look.

Regards,
Kharis

Thank you for sharing.

Try this code:

    .entry-content a:not(.comment-reply-link):not(.button):not(.roll-button):not(.elementor-button) {
      text-decoration: underline;
    }

    a.wp-block-button__link {
      text-decoration: none !important;
    }

Regards,
Kharis

That did it, thanks Khari

You’re welcome!

Please let us know in a new topic if you have any further questions, or if we can provide you with any other assistance.

Regards,
Kharis