Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inherited Text-Decoration style

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.

like image 817
JPero Avatar asked Aug 11 '09 17:08

JPero


1 Answers

I just found, that if you set position: absolute for block, it will work both in chrome and FF:

<span style="text-decoration:line-through;">
Dead Text 
<a href="#" style="text-decoration:underline;color:Red;">This not works</a>
</span>
<br/>
<span style="text-decoration:line-through;">
Dead Text 
<a href="#" style="position: absolute;margin-left: 5px;text-decoration:underline;color:Red;">This works</a>
</span>

Ugly, but can help in some cases;

like image 118
zb' Avatar answered Oct 05 '22 03:10

zb'