Can I change the vertical position of a strike-through on a website?

前端 未结 5 1117
被撕碎了的回忆
被撕碎了的回忆 2020-12-06 10:02

I\'m applying the strikeout tag

$5,000,000

But the line is too low.. .it\'s about 1/4 from the bottom rather than throug

5条回答
  •  执笔经年
    2020-12-06 10:23

    You could do something like this:

    Test heading
    .heading { position: relative; text-align:center; } .heading:before { background-color: #000000; content: ""; height: 1px; left: 0; position: absolute; right: 0; top: 50%; } .heading span { background-color: #fff; display: inline-block; padding: 0 2px; position: relative; text-align: center; }

    http://codepen.io/anon/pen/cLBls

提交回复
热议问题