【问题标题】:HTML: what are the percentages of the heading tags?HTML:标题标签的百分比是多少?
【发布时间】:2010-06-17 01:27:38
【问题描述】:

我刚刚用这个规范了字体大小:

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
 margin: 0;
 padding: 0;
 border: 0;
 outline: 0;
 font-size: 100%;
 vertical-align: baseline;
 background: transparent;
}

现在我想调整标题标签的大小,为<h1>, <h2> 提供百分比。像这样的:

h1 {font-size: 2em; margin: .67em 0;}
h2 {font-size: 180%; margin: .83em 0;}  
h3 {font-size: 1.17em; margin: 1em 0;}
h4 {font-size: 1em; margin: 1.33em 0;}
h5 {font-size: .83em; line-height: 1.17em; margin: 1.67em 0;}
h6 {font-size: .67em; margin: 2.33em 0;}
h1, h2, h3, h4, h5, h6 {font-weight: bolder;}

如你所见,我给了 h2 一个百分比,但其余的百分比是多少?

【问题讨论】:

  • 您只需要在body、div、input中设置字体样式,其余的将继承自这些元素。似乎您正在应用很多甚至不需要应用的样式。此外,中心元素已被弃用,您根本不应该使用它。

标签: html css font-size


【解决方案1】:

我发现此链接带有转换table

【讨论】:

    【解决方案2】:

    查看falowing链接,它可能会帮助您解决这个问题:

    CSS FONT SIZE em vs px vs pt vs %

    【讨论】:

      【解决方案3】:

      百分比可以是您想要的任何值。没有什么说 H1 必须大于 H2,这只是默认设置。

      【讨论】:

      • 确实如此,但似乎 user248959 想要遵循某种规则,为此,转换表很好;)
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-02
      • 2018-03-17
      • 1970-01-01
      • 2020-11-28
      • 2023-04-07
      相关资源
      最近更新 更多