私のHTMLは次のとおりです。変更取り消し線テキストの色を
<html>
<body>
<div id="example">this is example</div>
</body>
<html>
私のCSSは次のとおりです。
#example{text-decoration: line-through;color:#ccc;}
私はこの
のように外に置く取得していますが、私がしたいですこのように
私はできません。このようにするのを手伝ってください。
私の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
これは一例であり、それが正常に動作します。
HTML:
<div id="example">
this is example
<span></span>
</div>
CSS:
#example{
color:#ccc;
font-size: 20px;
position: relative;
display: inline-block;
}
#example span {
position: absolute;
width: 100%;
border-top: 1px solid red;
left: 0;
top: 50%;
}
doesntの仕事に複数の行ががあります – martin
http://stackoverflow.com/questions/1107551/css-strikethrough-different-color- from-text –