Следующая строка в принятом ответе неверна:
Любая настройка оформления текста на
потомок никогда не может "отменить"
текстовое оформление предка.
Никогда не говори никогда, верно?
Я пока не нашел решения для IE (если только вы не работаете со сценарием, в котором зачеркивание установлено на <TD>
), однако возможно для других браузеров, хотя вы будете приходится бороться с побочными эффектами решения.
Убедитесь сами в http://result.dabblet.com/gist/3713284/
Вкратце: просто добавьте display:table;
к стилю ребенка. По какой-то причине в FF вы можете использовать любой из table
, block
, list-item
или table-caption
, но они не работают в Safari / Chrome.
Используется код ниже:
<span style="text-decoration:line-through;">
Dead Text
<a href="#" style="text-decoration:underline;color:Red;">Undesired strikethrough</a>
</span>
<div style="text-decoration:line-through;">
Dead Text
<a href="#" style="text-decoration:underline;color:Red; display: table;">display: table in a div</a>
</div>
<span style="text-decoration:line-through;">
Dead Text
<a href="#" style="text-decoration:underline;color:Red; display: table;">display: table in a span</a>
</span>
<span style="text-decoration:line-through; display: block;">
Dead Text
<a href="#" style="text-decoration:underline;color:Red; display: table;">display: table in a span with "display:block;"</a>
</span>
<span style="text-decoration:line-through; display: table-cell;">
Dead Text
<a href="#" style="text-decoration:underline;color:Red; display: table;">display: table in a span with "display:table-cell;"</a>
</span>
<span style="text-decoration:line-through;">
Dead Text
<a href="#" style="text-decoration:underline;color:Red; display: list-item;">display: list-item</a>
</span>
<span style="text-decoration:line-through;">
Dead Text
<a href="#" style="text-decoration:underline;color:Red; display: table-caption;">display: table-caption;</a>
</span>