JSFiddle - React, Tailwind, and code Playground

HTML

<p>
    <span class="strike">hello world</span><br>
    <span class="center">hello  world</span>
</p>

<p>
    <span class="strike">x</span>
    <span class="center">x</span>
</p>

CSS

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

.center {
    position: relative;
    white-space: nowrap; /* would center line-through in the middle of the wrapped lines */
}

.center:after {
    border-top: 1px solid #000;
    position: absolute;
    content: "";
    right: 0;
    top:65%;
    left: 0;
}