How would I negate or remove a parents text-decoration style? For example in the following, both the text and the anchor have a text-decoration of line-through, is there a way to not have that applied to the anchor tag?
<span style="text-decoration:line-through;">
Dead Text
<a href="#" style="text-decoration:underline;color:Red;">Not Dead Text</a>
</span>
NOTE: wrapping the inner text in a span isn't an easy option with what I have so I'm looking for a solution based on the css styles if possible.
This works as well:
display: inline-block
I don't believe it's possible. From SitePoint:
I just found, that if you set position: absolute for block, it will work both in chrome and FF:
Ugly, but can help in some cases;
The following line in the accepted answer is incorrect:
Never say never, right?
I have not found a solution for IE yet (unless you happen to be working with a scenario where the strikethrough is set on a
<TD>
) however it is possible for other browsers, although you will have to battle the side-effects of the solution.See for yourself at http://result.dabblet.com/gist/3713284/
In short: just add
display:table;
to the child's style. For some reason in FF you can use any oftable
,block
,list-item
ortable-caption
but these don't work in Safari/Chrome.It uses the code below: