且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

链接下划线不会消失

更新时间:2022-10-19 13:43:10

我会告诉你, :

  .entry-content a,
.entry-summary a,
.taxonomy - 描述a,
。作为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;
}

其中 box-shadow:0 1px 0 0 currentColor ; 是所有这一切的负责人的儿子!



到底是什么 box-shadow ?为什么?



这是我在挖掘整个WordPress目录一小时后发现的。上面的代码位于主题的 style.css 文件中。无论如何,只要做

  box-shadow:none; 

终于摆脱了那个伤痕。


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?

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.