Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Link underline won't to go away

I'm writing a plugin for WordPress and when I add a link, the underline won't go away. The theme I'm using is twentysixteen. Here is my html:

<a class="thisisunique" href="#" style="text-decoration:none;">some text</a>

I'm astounded that this doesn't work, since the text-decoration is even inlined. I also included this in my CSS:

a.thisisunique, a.thisisunique:link, a.thisisunique:visited, a.thisisunique:hover, a.thisisunique:active, a.thisisunique:focus {
    text-decoration: none !important;
}

I even included code from a developer of the theme (https://wordpress.org/support/topic/remove-underline-from-links-2/), who explained that the theme doesn't use text-decoration, but border-bottom to achieve underlines (for whatever reason):

.entry-content a, .entry-summary a, .page-content a, .comment-content a, .pingback, .comment-body > a, .textwidget a {
    border-bottom: none;
}

but alas, that confounded underline remained.

What's also odd is that when I do text-decoration: overline;, it actually adds the overline to the link.

What in the world am I missing?

like image 731
hacksoi Avatar asked Jan 25 '26 11:01

hacksoi


1 Answers

I'll tell you what you're missing!:

.entry-content a,
.entry-summary a,
.taxonomy-description a,
.logged-in-as a,
.comment-content a,
.pingback .comment-body > a,
.textwidget a,
.entry-footer a:hover,
.site-info a:hover {
    box-shadow: 0 1px 0 0 currentColor;
}

Where box-shadow: 0 1px 0 0 currentColor; is the son of a gun responsible for all this!

What the heck is a box-shadow? WHY???

This is what I found after digging through my entire WordPress directory for an hour. The code above is in the theme's style.css file. Anyways, just doing

box-shadow: none;

finally got rid of that darn underline.

like image 70
hacksoi Avatar answered Jan 27 '26 00:01

hacksoi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!