zeidhaddadin Posted November 15, 2006 Share Posted November 15, 2006 Hi all, I have a "Web app development" exam 2morrow and I have this question about em and ex relative mesurement:Em is defined in w3schools as: one em is equal to the current font size of the current element.I didn't understand,, I mean what is the current font size of the current element?also the ex.and also can anyone tell me how to compare the em for example with pt..Thanks in advance,zeid Link to comment Share on other sites More sharing options...
vchris Posted November 15, 2006 Share Posted November 15, 2006 It means the default em size is 1em and I pretty sure it's equal to 12 pt. Try it yourself on a page. Create 1 paragraph in 1em and another in 12pt.never heard of ex. Link to comment Share on other sites More sharing options...
jlhaslip Posted November 15, 2006 Share Posted November 15, 2006 Isn't an 'em' the width taken by a lower-case letter 'm' at the current Font-size? Link to comment Share on other sites More sharing options...
boen_robot Posted November 16, 2006 Share Posted November 16, 2006 If we believe W3Schools, then it has to be the current font size.And by "current", they mean either the default font the browser has specified for itself, OR the font we've specified for a parent element.Different browsers have different default fonts, so "em" is always very relative, unless you specify a font with pixels and then use "em"s on the elements' childs.As for "ex". According to the reference it's "the x-height of a font (x-height is usually about half the font-size)". In other words, the height of the letter "X" in the current font. That height again varies, depening on the font family. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now