Override "text-decoration: line-through" for ": before /: after" pseudo-class

Do you know why line-throughtext-decoration is :beforenot overridden?

Demo: 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;
}

Any ideas how to make only part of the text line-throughwithout adding an additional element, for example <span>?

+4
source share
1 answer

Add display: inline-blockcss pseudo element properties

+9
source

Source: https://habr.com/ru/post/1545133/


All Articles