我在我的 CSS 中使用了不同的行高,这导致我的垂直间距出现问题。我希望水平线上方的数量与下方相同。
这是我的问题的一个例子:
我的 HTML
<div class="intro">
<p>The powered flight took a total of about eight and a half minutes. It seemed to me it had gone by in a lash. We had gone from sitting still on the launch pad at the Kennedy Space Center to traveling at 17,500 miles an hour in that eight and a half minutes. It is still mind-boggling to me. </p>
</div>
<hr />
<div class="normal">
<p>I recall making some statement on the air-to-ground radio for the benefit of my fellow astronauts, who had also been in the program a long time, that it was well worth the wait.</p>
</div>
<hr />
<div class="normal">
<p>The powered flight took a total of about eight and a half minutes. It seemed to me it had gone by in a lash. We had gone from sitting still on the launch pad at the Kennedy Space Center to traveling at 17,500 miles an hour in that eight and a half minutes. It is still mind-boggling to me.</p>
</div>
我的 CSS
.intro p { margin-bottom: 24px; font-size: 24px; line-height:36px; }
.normal p { margin-bottom: 18px; font-size: 16px; line-height:18px; }
hr { border-top: 1px solid rgb(200,200,200); margin: 10px 0}
你也可以在这里看到它:http: //codepen.io/dachan/pen/Csueb
我的问题有什么解决方案,减去必须手动为 hr 标签创建不同的边距?
此外,我确实打算拥有多个段落,因此任何省略边距底部的解决方案都不适合我。