I'm trying to figure out why, after floating a span, that its contents no longer inherit some of the style of its parent, and how to make it do so.
p {
text-decoration: line-through;
color: green;
}
span {
float: left;
height:2em;
}
<p><span>Lorem ipsum </span> dolor sit amet...</p>
The p's color transfers just fine, but the text-decoration does not. I know I can just add the text-decoration to the span's style, but I'm wondering if there's another way*.
- The line-through is actually applied or removed conditionally through javascript and I'd rather avoid the need for extra lines to toggle the effect for the span as well as the p.