Welcome to WebmasterWorld Guest from 54.146.5.196

Forum Moderators: not2easy

Message Too Old, No Replies

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

What are the REAL differences?

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

Senior Member

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

joined:Feb 4, 2002
posts:5044
votes: 0


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

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

Senior Member

WebmasterWorld Senior Member topr8 is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 19, 2002
posts:3287
votes: 23


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)
12:57 pm on Jan 8, 2003 (gmt 0)

Full Member

10+ Year Member

joined:Dec 13, 2002
posts:307
votes: 0


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.
1:22 pm on Jan 8, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:July 9, 2002
posts:134
votes: 0


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.

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

Senior Member

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

joined:Feb 4, 2002
posts:5044
votes: 0


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

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

Full Member

10+ Year Member

joined:Dec 13, 2002
posts:307
votes: 0


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.
6:13 pm on Jan 8, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Sept 14, 2002
posts:157
votes: 0


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>

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members