Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change strike-through text color in css [duplicate]

Tags:

html

css

My html is:

<html>  
<body>  
     <div id="example">this is example</div>  
</body>  
<html>

My css is:

#example{text-decoration: line-through;color:#ccc;} 

I am getting out-put like this
out-put image
but I want like this
i am trying to do like this but I can't. Help me to do like this.

like image 410
Suresh Pattu Avatar asked Jan 04 '12 08:01

Suresh Pattu


1 Answers

Color applies to the line through and text. You need to nest like.

<span style="text-decoration: line-through; color: red;">
 <span style="color: #CCC;">text with red linethrough and black text</span>
</span>

Source: http://www.savio.no/artikler/a/335/different-font-color-than-line-through-color-with-css

like image 129
benni_mac_b Avatar answered Oct 20 '22 23:10

benni_mac_b