为“:before /:after”伪类重写“text-decoration:line-through”

时间:2014-06-18 20:01:24

标签: html css

您知道为什么line-through的{​​{1}}文字修饰没有被覆盖吗?

演示:http://jsfiddle.net/FZJYW/

HTML

:before

CSS

<p>Should be strike-through</p>

如何在不添加额外元素的情况下仅制作文本p { text-decoration: line-through; } p:before { content: "Should not be strike-through. "; text-decoration: none !important; } 的一部分的任何想法,例如line-through

1 个答案:

答案 0 :(得分:9)

display: inline-block添加到伪元素的css属性

相关问题