Line-height can be set as a value in pixels (ie,
'20px'
) or a unitless value (ie.
'1'
); the default is
'normal'
. But what is normal? It is often written that
Line-Height
should be
1
, or
1.2
, amd the CSS spec is unclear on this. Unitless line-height is font-size relative, but the problem is that
font-size: 100px
behaves differently across font-families, so is line-height always the same or is it different? Is it really between 1 and 1.2? What are the implications regarding line-height and vertical-align?
Font-size: 100px
does not create elements with 100px height I’ve measured and found these values: Helvetica: 115px, Gruppo: 97px and Catamaran: 164px.
c./.images/00-0-Copr_2019-vdo.pngc |
|
|
When a <p> element is rendered on screen, it can be composed of many lines, each line is made up of one or many elements (HTML tags, text) and is called a 'line-box'. The height of a line-box is based on its children’s largest height.