删除超链接的下划线并删除一些元素:text-decoration: none with text-decoration: line-through

Remove Underline for Hyperlink and strike some elements : text-decoration: none with text-decoration: line-through

所以我在这里试图实现的是,我不希望任何超链接带有下划线,同时我希望某些元素被删除。

他们两个单独工作都很好,但我不能同时工作。

代码:

a:link    {
    text-decoration:  none 
  } 

.deceased {
  text-decoration: line-through;
}

所以我猜问题出在选择器的特异性上。我相信 a:link 选择器更具体,因此它优先于 .deceased。我会说最简单的解决方案是改变特异性。

检查这里 http://www.htmldog.com/guides/css/intermediate/specificity/ 和这里 http://dorward.me.uk/www/underline/