(Not to be confused with Xunit , the popular .Net module testing library.)
Today, in a fit of boredom, I began to inspect the Gmails DOM (yes, I was very bored).
Everything looked pretty simple until I noticed an interesting spec on the width of some elements. Famous googlinites indicated a series of columns using the rare ex unit.
width: 22ex;
At first I was at a dead end ("what is" ex "?), Then he came back to me: I seem to remember something many years ago when I first learned about CSS. From the CSS3 specification :
[ ex unit ] is equal to the used x-height of the first available font . X-height is called so because it is often equal to the height of the lower case "x". However, the ex expression is even defined for fonts that do not contain "x".
Well, good. But I had never seen it before (I used it myself much less). I use ems quite often and appreciate their value, but why "ex"? This seems a much less standard dimension than em, and much less useful.
One of the few pages I have found in this section is Stephen Powley http://www.xs4all.nl/~sbpoley/webmatters/emex.html . Steven makes good points, but his discussion seems unconvincing to me.
So my question is: What is the meaning of the ex unit for web design?
(This question may be marked subjective, but I will leave this solution to more experienced SO'ers than me.)
units-of-measurement css specifications
Joel May 28 '09 at 12:21 a.m. 2009-05-28 00:21
source share