Welcome to WebmasterWorld Guest from 54.221.28.179

Forum Moderators: not2easy

Message Too Old, No Replies

Difference Between %'s an EM's as Font Units

What are the REAL differences?

     

Nick_W

11:34 am on Jan 8, 2003 (gmt 0)

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Hi all,

As far as I can make out the real diffence is only browser support. %'s have a slightly better acceptance in older browsers than the EM.

Personally I prefer EM's though as they're a dedicated font unit. Your thoughts?

Nick

topr8

11:49 am on Jan 8, 2003 (gmt 0)

WebmasterWorld Senior Member topr8 is a WebmasterWorld Top Contributor of All Time 10+ Year Member



i've always used % as i figured it works on a percentage scale of the default size font, so that if someone has set it bigger then it comes up relative to their preference rather than forcing a size (which has advantages for layout)

WibbleWobble

12:57 pm on Jan 8, 2003 (gmt 0)

10+ Year Member



Doesn't having 0.9em resize it relative to their font, too? Thats the impression I have.
I've always been a tad baffled by ems, they're just weird. I use them, but still. Weird.

chameleon

1:22 pm on Jan 8, 2003 (gmt 0)

10+ Year Member



Doesn't having 0.9em resize it relative to their font, too?

Yes, it does.

In my experience with IE, however, 0.9EM does not equal 90%.

I'm not sure how they're calculating the EMs or the percentages, but somehow the calculations are different.

Netscape and IE also calculate EMs differently. If I'm not mistaken, RichInStyle.com has more info on this topic.

Nick_W

2:19 pm on Jan 8, 2003 (gmt 0)

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Well, the model for font units says that 0.9em should equal 90% - I always use em's. 1em = the container default which means that not setting a font size leaves it at the uesrs preferred size.

Of course that's all so much crap when you think about how many people have no idea of how to change their font size! but, it beats absolute units hands down ;)

Nick

WibbleWobble

2:44 pm on Jan 8, 2003 (gmt 0)

10+ Year Member



I always have real trouble forcing myself to let people decide on the font size themselves, partly because anything over 14px/12pt looks really, really terrible, in my opinion.
Don't get me wrong, I know there are people out there who need to have bigger text, but I don't like them ruining what is essentially a lovely design and layout by being poor-sighted. I'm fickle.

marek

6:13 pm on Jan 8, 2003 (gmt 0)

10+ Year Member



0.9em should equal 90%, but in IE/Win this is true only if medium font size is set in the browser, or basic font size in CSS is set by percents. Try to view the following two simple exmaples in IE6/Win and change your font size to smallest.

Example #1

h1 {font-size: 3em}
p {font-size: 0.8em}

Example #2

body {font-size: 100%}
h1 {font-size: 3em}
p {font-size: 0.8em}

HTML for the both samples above:

<body>
<h1>Test</h1>
<p>test test test test test test</p>
</body>

 

Featured Threads

Hot Threads This Week

Hot Threads This Month