Quantcast
Channel: CSS strikethrough different color from text? - Stack Overflow
Viewing all articles
Browse latest Browse all 17

Answer by ibolmo for CSS strikethrough different color from text?

$
0
0

Adding to @gojomo you could use :after pseudo element for the additional element. The only caveat is that you'll need to define your innerText in a data-text attribute since CSS has limited content functions.

s {  color: red;  text-align: -1000em;  overflow: hidden;}s:after {  color: black;  content: attr(data-text);}
<s data-text="Strikethrough">Strikethrough</s>

Viewing all articles
Browse latest Browse all 17

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>