为什么< h5>和< h6>字体大小小于< p>在大多数用户代理默认样式表中? [英] Why do <h5> and <h6> have smaller font sizes than <p> in most user agent default stylesheets?
问题描述
(上面的默认正文字体大小为 14px
)
这似乎是违反直觉的:标题应该引起人们的注意并控制部分的开始,字体大小是重要的视觉提示。
我一直在搜索其中,是否有原因使默认字体大小使这些标题小于其下的文字? W3C邮件列表,但尚未对此决定进行任何辩论。
这是我可以推断的内容:
1995
首次发布的版本的HTML规范(在CSS出现之前)实际上指定,即 h4
和 h5
的大小应为常规字体。 h6
的字体大小没有明确指定,但我想它也是正常的字体大小。
< blockquote>
H3
斜体,大字体,从
的左边距略微缩进。上方和下方有一两个空白行。
H4
加粗的普通字体比H3缩进更多。上方和下方有一个空白行
。
H5
斜体,普通字体,缩进为H4。上面有一个空白行
。
H6
加粗,缩进与普通文本相同,比H5大。上面有一个
空白行。
1996
CSS突然出现在现场。或者说真的,缩在场景中,然后布鲁克。为浏览器指定的第一个推荐的默认样式表:
H1 {字体大小:xx大}
H2 {字体大小:x大}
H3 {字体大小:大}
h4
到 h6
将因此为 1em
。
1997
HTML 3.2删除了相对于文档文本的所有字体大小建议,仅推荐:
更重要的标题通常以比不重要的标题更大的字体呈现。
这与CSS1有点冲突,但两者在当时并不相互融合。大多数样式仍然是使用内联HTML属性完成的,这些属性仍然没有被弃用。
1998
CSS2出来,并从其自己的规范中删除了默认样式表,而是链接到新的样本 HTML的规范中的HTML 4.0样式表。
这是标头的来源,显式设置为小于 1em
,至少据我所知。推荐的HTML 4.0样式表指定了大多数浏览器将直到今天保留为默认值:
H5 {font-size:.83em;行高:1.17em;边距:1.67em 0}
H6 {font-size:.67em;保证金:2.33em 0}
The default <h5>
and <h6>
section headings in HTML5 have font sizes of 0.83em
and 0.67em
, respectively, while the default <p>
font size is 1em
. That means in a block of text containing <h5>
, <h6>
and <p>
tags, these headings will be smaller than the text they head:
(Default body font size above is 14px
)
This seems counter-intuitive: headings are supposed to draw the eye and command the start of a section, and font size is an important visual cue. Is there a reason why the default font sizes make these headings smaller than the text under them?
I've been searching through W3C mailing lists but haven't found any debate on this decision.
Here's what I can infer:
1995
The first published version of the HTML spec (before CSS came into play) actually specified that h4
and h5
should be "normal font" size. The font size for h6
wasn't explicitly specified, but I would presume that it was also the normal font size.
H3 Italic, large font, slightly indented from the left margin. One or two blank lines above and below. H4 Bold, normal font, indented more than H3. One blank line above and below. H5 Italic, normal font, indented as H4. One blank line above. H6 Bold, indented same as normal text, more than H5. One blank line above.
1996
CSS broke onto the scene. Or really, limped onto the scene and broke. The first recommended default style sheet for browsers specified only:
H1 { font-size: xx-large } H2 { font-size: x-large } H3 { font-size: large }
h4
through h6
would thus be 1em
.
1997
HTML 3.2 dropped any font-size recommendations relative to document text, only recommending:
More important headings are generally rendered in a larger font than less important ones.
This conflicts a bit with CSS1, but the two were not integral to each other at the time. Most styling was still done with inline HTML attributes, which were still very much not deprecated.
1998
CSS2 came out, and it removed a default style sheet from its own spec, and instead linked to the new sample style sheet for HTML 4.0 in HTML's specification.
This is the origin of headers explicitly being set smaller than 1em
, at least as far as I can tell. The recommended HTML 4.0 stylesheet specifies the values most browsers keep to today as defaults:
H5 { font-size: .83em; line-height: 1.17em; margin: 1.67em 0 } H6 { font-size: .67em; margin: 2.33em 0 }
这篇关于为什么< h5>和< h6>字体大小小于< p>在大多数用户代理默认样式表中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!