[英]Override “text-decoration: line-through” for “:before/:after” pseudo class
Do you know why the line-through
text-decoration for :before
isn't being overridden? 你知道为什么
line-through
文本装饰:before
没有被覆盖?
Demo: http://jsfiddle.net/FZJYW/ 演示: http : //jsfiddle.net/FZJYW/
HTML HTML
<p>Should be strike-through</p>
CSS CSS
p {
text-decoration: line-through;
}
p:before {
content: "Should not be strike-through. ";
text-decoration: none !important;
}
Any ideas how to make only part of text line-through
without adding an extra element, like <span>
? 任何想法如何只
line-through
不添加额外元素(如<span>
?
将display: inline-block
添加到伪元素的css属性中
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.