本文介绍了链接在gatsby中有一个额外的下划线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不确定这与CSS有关.在 gatsby-starter-blog 中,links()带有下划线.我的意思是,当您查看源代码时,将看到文本修饰:none;这行得通!(您可以尝试将其更改为下划线,直通等),但是,链接还有其他几行,我无法摆脱它们.

I am not sure this is about CSS. In gatsby-starter-blog links( ) have additional underline. I mean, when you look at the source code, you will see text-decoration: none; And this works! (You can try to change it underline, line-through etc), however, there are additional lines for links and I cannot get rid of them.

推荐答案

他们有一个 box-shadow 道具,为下划线提供了这种方式(这样,它的间隔会更宽一些,并且看起来会更好,而不是下划线):

They have a box-shadow prop giving the underline (That way it's spaced a little wider and gives a nicer look instead of a tight underline):

a {
  /* This first prop */
  box-shadow: 0 1px 0 0 currentColor;
  color: #007acc;
  text-decoration: none;
}

因此只需使用您的自定义CSS取消即可:

so just cancel it out with your custom css:

a {
  box-shadow: none;
}

这篇关于链接在gatsby中有一个额外的下划线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-18 17:17