【问题标题】:Override “text-decoration: line-through” for “:before/:after” pseudo class为“:before/:after”伪类覆盖“text-decoration: line-through”
【发布时间】:2014-06-18 20:01:23
【问题描述】:

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

演示: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,例如&lt;span&gt;

【问题讨论】:

标签: html css


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-11-17
    • 2012-01-02
    • 2019-07-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多