简体   繁体   English

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

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM