

the ascender is 1100 and the descender is 540.Let’s take the Catamaran font and open it in FontForge to get metrics: in the browser, relative units are scaled to fit the desired font-size.Note that some values can bleed outside of the em-square. based on its relative units, metrics of the fonts are set (ascender, descender, capital height, x-height, etc.).

But it can also be 1024, 2048 or anything else. This square uses relative units and is generally set at 1000 units.
/justified-text-56a9f5313df78cf772abc223.png)
We know that 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 different? Is it really between 1 and 1.2? And vertical-align, what are its implications regarding line-height?ĭeep dive into a not-so-simple CSS mechanism… Let’s talk about font-size first OK, but what normal is? We often read that it is (or should be) 1, or maybe 1.2, even the CSS spec is unclear on that point. They really are complex, maybe the hardest ones, as they have a major role in the creation of one of the less-known feature of CSS: inline formatting context.įor example, line-height can be set as a length or a unitless value 1, but the default is normal. So simple that most of us are convinced to fully understand how they work and how to use them. Line-height and vertical-align are simple CSS properties.
