在接受回答以下行不正确:
在 后裔框的任何文本装饰设置可从来没有“撤销”的祖先盒子的 文本修饰。
永远不要说永远不对吧?
我还没有找到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>
呃。这就是我所害怕的。感谢您的答案和链接,它解释得很好! – JPero 2009-08-11 18:05:44
其实,在特定的情况下,它*是可能的!我在下面的答案中添加了更完整的说明:-) – Potherca 2011-01-15 20:21:02