I have a span tag inside a td. The td has a class with CSS to set the text-decoration to underline, while the span sets the text-decoration to none. I expect the text inside the span to not be underlined, but for some reason it is. Why?
.u {
text-decoration: underline;
}
.no-u {
text-decoration: none !important;
}
<table>
<tr>
<td class="u">
<span class="no-u" style="text-decoration: none !important;">My Text</span>
</td>
</tr>
</table>
Cannot remove the underlined style for descendants.
http://www.w3.org/TR/CSS21/text.html#lining-striking-props
The 'text-decoration' property on descendant elements cannot have any effect on the decoration of the ancestor.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With