CSS Line-Through not being removed

css, html

Solution

You shouldn't have to use important or inline styles for this. Try

h2 {text-decoration:line-through;}
h2 span {text-decoration: none; border: 1px solid black;}

EDIT

In that case with tr since yeah you applied text-decoration to it, you have to take text-decoration off the same element tr not td. Otherwise do:

tr td { text-decoration: whatever }

and then when needed

<td style="text-decoration: none;"></td>

Problem

I've got some code that puts a line-through on a TR for deleted rows, but this means that my "Actions" column (that only has) buttons suffers. This is because there are individual spaces between the buttons, which wind up getting line-throughed as well. After poking around on W3Schools, it boggles me why this example doesn't work: ``` <html> <head> <style type="text/css"> tr {text-decoration:line-through} </style> </head> <body> <table> <tr> <td>this needs to be line-throughed</td> <td style="text-decoration: none !important;">This shouldn't be line-throughed.</td> </tr> </table> </body> </html> ``` How am I supposed to clear the line-through on child elements? EDIT I've updated my example - the problem is that I do not want to take the style off the parent element, just a single child element.

Original source

Related problems