我想删除行与行之间的多余空格,但仅限于这部分。不在任何其他页面上。基本上,我希望以 -- 开头的行直接出现在其上方的文本下方。我确实也需要保留标签的填充。我猜这将通过类 ID 完成,但不确定我将使用的 css 代码。利润?类似的东西
<h3 class="removeSpace">
HTML
<h3><em>Some text here</em></h3><h3> – blah blah blah</h3>
<h3><em>Other text here</em></h3><h3> – yadda yadda yadda</h3>
<h3><em>More text here</em></h3><h3> – blah blah blah</h3>
CSS
h3 {
color: #7093DB;
padding-left: 300px;
}
最佳答案
您在 margin
的正确轨道上
使用 div 包装器和跨度以另一种方式执行此操作可能更清晰,但如果您想更改 h3 标签,您可以这样做:
h3 {
color: #7093DB;
padding-left: 300px;
}
.removespace {
margin-bottom: 0;
}
.child {
margin-top: 0;
}
<h3 class="removespace"><em>Some text here</em></h3><h3 class="child"> – blah blah blah</h3>
<h3 class="removespace"><em>Other text here</em></h3><h3 class="child"> – yadda yadda yadda</h3>
<h3 class="removespace"><em>More text here</em></h3><h3 class="child"> – blah blah blah</h3>
关于html - 删除行之间的空间,仅单页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48937164/