簡體   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