我正在努力瞄准当前的标签层次结构(CSS新手)。我想要实现的是删除以下示例中引用之间的linspace / linebreak / whitespace:
参考
我正在使用markdown和pandoc构建这个引用列表,这个输出是我必须使用的:
<h3 id="references" class="unnumbered">
References
</h3>
<div id="refs" class="references">
<div id="ref-WilleDevelopmentEQ5DYchildfriendly2010">
<p>
<ol style="list-style-type: decimal">
<li>Wille, N., Badia, X., Bonsel, G., Burström, K., Cavrini, G., Devlin, N., … Ravens-Sieberer, U. (2010). Development of the EQ-5D-Y: A child-friendly version of the EQ-5D. <em>Quality of Life Research</em>, <em>19</em>(6), 875–886. doi:<a href="https://doi.org/10.1007/s11136-010-9648-y">10.1007/s11136-010-9648-y</a>
</p>
</div>
<div id="ref-Ravens-SiebererFeasibilityreliabilityvalidity2010">
<p>
<ol start="2" style="list-style-type: decimal">
<li>Ravens-Sieberer, U., Wille, N., Badia, X., Bonsel, G., Burström, K., Cavrini, G., … Greiner, W. (2010). Feasibility, reliability, and validity of the EQ-5D-Y: Results from a multinational study. <em>Quality of Life Research</em>, <em>19</em>(6), 887–897. doi:<a href="https://doi.org/10.1007/s11136-010-9649-x">10.1007/s11136-010-9649-x</a>
</p>
</div>
我试图给父母font-size: 0
和div id refs
class references
和使用通配符<div id="ref-...">
的特定ids div[id^="ref-"]
分开font-size。我已经阅读了很多类似的问题,但未能解决这个问题。我怀疑我必须在特定的<p>
中瞄准<ol>
,<li>
或div
标签,但是我们已经能够让它发挥作用。
更新:谢谢你的回复,我看到一些澄清是必要的; 1.上面的结构是自动生成的,我宁愿不手动编辑HTML,2。引用是一个长文档的结尾,我可能需要p标签,因为它们是为了使主文本具有某些属性,如字体,字体大小和行间距。
默认情况下,大多数浏览器在<p>
的1em
标签上定义顶部和底部边距(请参阅here)。所以尝试删除它:
p {
margin-top: 0;
margin-bottom: 0;
}