如何在 IE 中为锚伪元素删除 css 中的下划线

How to remove underline in css for anchors pseudo element in IE

如何在 Internet Explorer 中删除 CSS 伪元素的 text-decoration: underline

+ 图标在其他浏览器中没有下划线(如 Google Chrome),但在 Internet Explorer 中 + 图标有下划线。如何去除 Internet Explorer 的下划线?

代码 (https://jsfiddle.net/u5m067xq/4/):

h3 a { 
  text-decoration:underline;
}
h3 a:before {
  display:inline-block;
  content: '+';
  margin:0;
  padding: 4px;
  text-decoration:none;
}
 <h3><a href="#">link</a></h3>

此代码按您预期的方式工作。 a 标签的默认样式是 text-decoration: underline。您必须将其设置为 none.

span {
  text-decoration: underline;
}
h3 a:before {
  display: inline-block;
  content: '+';
  margin: 0;
  padding: 4px;
  text-decoration: none;
}
a {
  text-decoration: none;
}
<h3><a href="#"><span>link</span></a></h3>