如何删除 text-decoration: underline 用于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 .
a
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>