H1-H6 font sizes in HTML

前端 未结 11 529

In HTML (and in typography in general, I suppose), there appears to be some defined sizes for H1-H6 -elements.

Ie., if the baseline font size is 16px (or 100%), then h1

11条回答
  •  借酒劲吻你
    2021-01-29 22:26

    One possible progression approach is to use square roots, via a formula such as 2/sqrt[heading#]. Hence, you'd have:

    H1 = 2/sqrt1 = 2
    H2 = 2/sqrt2 = 1.414
    H3 = 2/sqrt3 = 1.155
    H4 = 2/sqrt4 = 1
    H5 = 2/sqrt5 = 0.894
    H6 = 2/sqrt6 = 0.816
    

    For a font base of 12, that'd be close enough to 24, 17, 14, 12, 11, 10. For other bases, the results may be a bit farther away from integers.

    Fibonacci would work well with base 16, so you'd have:

    H1=32
    H2=24
    H3=19
    H4=16
    H5=14
    H6=13
    

提交回复
热议问题