为什么括号"()"没有在CSS中加下划线?

Kee*_*uva 0 html css

我在网上搜索过,但我没有找到任何解决办法.

我也希望括号下划线.

a {
  text-decoration: underline;
}
Run Code Online (Sandbox Code Playgroud)
<a href='#'>hhh(9)</a>
Run Code Online (Sandbox Code Playgroud)

小智 8

这是因为在最新版本的Chrome(版本64)中,它们似乎已启用text-decoration-skip-ink默认用户代理样式并已将其设置为auto.要删除它,请将其添加到CSS(将应用于所有样式):

* {
  text-decoration-skip-ink: none;
}
Run Code Online (Sandbox Code Playgroud)

有关 MDN的更多信息:

text-decoration-skip-ink CSS属性指定在通过字形上升和下移时如何绘制上划线和下划线.

/* Single keyword */
text-decoration-skip-ink: none;
text-decoration-skip-ink: auto;

/* Global keywords */
text-decoration-skip: inherit;
text-decoration-skip: initial;
text-decoration-skip: unset;
Run Code Online (Sandbox Code Playgroud)

以下是使用上述代码的示例:

a {
  text-decoration: underline;
  text-decoration-skip-ink: none;
}
Run Code Online (Sandbox Code Playgroud)
<a href='#'>hhh(9)</a>
Run Code Online (Sandbox Code Playgroud)