1

我有 99% 的把握我没有在这里忽略某些东西。我已经完成了通常的重置,h 标签上没有边距或填充,line-height:100% 等等等。但是在 h 标签的上方和下方仍然有大约 2 或 3px 的填充。在大多数主要网站上都是一样的,所以我猜这是不可避免的吗?这似乎是一个没有实际意义的问题,但它稍微弄乱了我的对齐方式。

那么是否存在一些不可避免的问题,即无论您做什么,所有字体周围都有轻微的填充?

4

2 回答 2

0

干得好:

HTML

<div id="blah"> <div style="width:300px; margin:0px auto 0px auto;"><h1 style="color:#000000;font-size:12px; display:inline">This is my heading</h1></div> </div>

CSS

#blah
{
height:50px;
width:100%;
background-color:#B40700;
}
于 2013-07-25T10:20:29.497 回答
0

不要忘记可以为布局添加“静默”空间的隐式换行符:

<h1>blah blah</h1>[space character here due to line break]
<h1>blah blah</h1>

需要是:

<h1>blah blah</h1><h1>blah blah</h1>
于 2011-08-09T15:44:40.883 回答