【发布时间】:2014-11-30 08:30:09
【问题描述】:
给定以下 HTML,<p> 元素的总高度是多少?我认为这将是 1em,但似乎并非如此。低于基线的字母似乎位于某种超出字体高度的边距上。
<html>
<head>
<style>
p {
margin: 0;
padding: 0;
font-size: 1em;
font-family: serif;
border: 1px solid black;
}
</style>
</head>
<body>
<p>Lorem ipsum.</p>
</body>
</html>
【问题讨论】:
-
没有属性作为
font-height使用line-height -
我觉得你需要
line-height! -
尝试
display:inline-block和vertical-align而非baselineliebdich.biz/inlineblockincss -
对不起,我的意思是
font-size。
标签: html css fonts graphic-design