您知道为什么line-through
的{{1}}文字修饰没有被覆盖吗?
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
?
答案 0 :(得分:9)
将display: inline-block
添加到伪元素的css属性