我想绘制一个水平线约40%的宽度,然后显示一个字体真棒图标,然后再次为剩余的40%线。以下显示了我迄今为止的内容。但是你可以看到https://jsfiddle.net/hyo0ezeo/,它并不是我所描述的任何地方。请有人指出正确的方法来做到这一点?在水平线中间添加字体真棒图标
CSS
h2 {
width: 30%;
text-align: center;
border-bottom: 1px solid red;
line-height: 0.1em;
margin: 10px 0 ;
}
HTML
<div>
<h2>
<span class="fa fa-arrows-alt" aria-hidden="true" style="margin:10px 0"></span>
</h2>
</div>
为什么是H2宽度的30%和不是100%? –