7

Do you know why the line-through text-decoration for :before isn’t being 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 text line-through without adding an extra element, like <span>?

Alex
  • 1,576
  • 3
  • 17
  • 35
  • 2
    possible duplicate of [“text-decoration” and the “:after” pseudo-element, revisited](http://stackoverflow.com/questions/1238881/text-decoration-and-the-after-pseudo-element-revisited) – Paulie_D Jun 18 '14 at 20:04

1 Answers1

11

Add display: inline-block to the pseudo element's css properties

Gray Spectrum
  • 723
  • 2
  • 7
  • 21