What is the value of the css ‘ex’ unit?

It is useful when you want to size something in relation to the height of your text’s lowercase letters. For example, imagine working on a design like so:

alt text

In the typographic dimension of design, the height of letters has important spatial relationships to the rest of the elements. The lines in the source image above are intended to help point out the x-height of the text, but they also show where guidelines would be if designing around that text.

As Jonathan pointed out in the comments, ex is simply the height version of em (width).

Leave a Comment