这个问题已经在这里有了答案:
9年前关闭。
我的html是:
<html>
<body>
<div id="example">this is example</div>
</body>
<html>
我的CSS是:
#example{text-decoration: line-through;color:#ccc;}
我正在像 这样输出,但是我想要这样但我不能。帮我做这个。
最佳答案
颜色适用于直通线和文本。您需要像嵌套一样。
<span style="text-decoration: line-through; color: red;">
<span style="color: #CCC;">text with red linethrough and black text</span>
</span>
资料来源:http://www.savio.no/artikler/a/335/different-font-color-than-line-through-color-with-css