I would like to cross out a text within a span
. Currently I have this
.content {}
.pending {}
.closed {
position: relative;
}
.closed::before {
position: absolute;
content: "";
left: 0;
top: 50%;
right: 0;
border-top: 2px solid red;
}
<div class="content pending">
this is a text about foo
</div>
<div class="content closed">
this is a text about bar
</div>
How can I limit the border to the current content? I only want to cross out the text, not the full container.
I don't want to use the <s>
tag because I would like to style the line.
Maybe there is completely different way to solve this?