例如,我的<p>有一个font-size:20px和一个line-height:50px。<h1>和<h2>还有一些其他的值。我希望从我的<p>文本到字母顶部(递增)到下一个元素(例如h1或h2 )的基线距离为35px。我如何通过css实现这一点呢?
使用空白符总是给出行高之间的距离,而不是字母之间的距离。
发布于 2014-09-29 19:21:50
您需要重置所有元素的line-height, padding, margin。之后,将padding-bottom:35px应用于元素p,h1,h2。
* {line-height:24px !important; padding:0; margin:0;}
p,h1,h2{padding-bottom:35px;}https://stackoverflow.com/questions/26096234
复制相似问题