1

I have a tr(table row) that needs to be strike through .. but there is some content which should not apply the css so i have created a separate class for it but it does not seem to work ..

HTML

<tr class="status">
    <td class="content" width="100%" align="left" >
        <span class="subheading">
            sub-Heading
        </span>
        Content
    </td>
</tr>

CSS

.status {
text-decoration: line-through;
}
.status .subheading{
text-decoration: none !important;
}

Any ideas or corrections are welcomed ..

Rafay
  • 603
  • 2
  • 9
  • 24

3 Answers3

1

As per documentation Its not possible ..

https://www.w3.org/TR/CSS21/text.html#lining-striking-props

Solution:

HTML

<tr>
    <td class="content" width="100%" align="left" >
        <span class="subheading">
            sub-Heading
        </span>
        <span class="status">
        Content
        </span>
    </td>
</tr>

CSS

.status {
text-decoration: line-through;
}

Yes it creates a messier code ..

Rafay
  • 603
  • 2
  • 9
  • 24
0

I think you have an error in your CSS where your use of '!important' with the .status selector overrides your strikethrough, I would try correcting the CSS like this:

.status {
    text-decoration: line-through;
}
.subheading{
   text-decoration: none !important;
}

Also remember that the property 'text-decoration: line-through;' only draws a line through text and wont strikethrough a tr or td element.

Samuel Barnes
  • 113
  • 10
  • if i remove the .status before .subheading this would make the changes to where ever it is called .. which can be correct but its not working .. I included .status because i only want subheading which are under status to apply the css – Rafay May 11 '16 at 11:25
0

CSS

.content span:nth-child(1)
{
text-decoration: line-through;
}
</style>

HTML

<table>
        <tr class="status">
<td class="content" width="100%" align="left" >

        sub-Heading

   <span>Content</span> 
</td>

Now i have no idea how many <td>'s you have in your <tr>. but this is how i got the answer you're looking for in the given code.