If you canβt use text layout: in turn, you probably have padding or margins on your div, so the line does not go all the way. This snippet draws a line with a width div and through the text, preserving your margins or margins.
<div style="border:solid 2px black; padding : 100px"> <div class="strike-through" style="border-bottom : solid 1px red; margin-bottom : -12px;"></div> <div style="text-align : center; padding-left:50px; padding-right:50px; border : solid 1px green;">Lorem Ipsum Voluptatem</div> </div>
source share