这大致就是我要做的:通过
border-bottom在containing上设置a ,
h2然后再给
h2a small 来创建该行
line-height。然后将文本放在
span具有非透明背景的嵌套中。
h2 { width: 100%; text-align: center; border-bottom: 1px solid #000; line-height: 0.1em; margin: 10px 0 20px;}h2 span { background:#fff; padding:0 10px;}<h2><span>THIS IS A TEST</span></h2><p>this is some content other</p>我仅在Chrome中进行过测试,但是没有理由它不能在其他浏览器中运行。



