繁体   English   中英

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

[英]Override “text-decoration: line-through” for “:before/:after” pseudo class

你知道为什么line-through文本装饰:before没有被覆盖?

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

HTML

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

CSS

p {
  text-decoration: line-through;
}

p:before {
  content: "Should not be strike-through. ";
  text-decoration: none !important;
}

任何想法如何只line-through不添加额外元素(如<span>

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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