Forum Moderators: not2easy

Message Too Old, No Replies

using em instead of pixels?

         

12inch

8:27 am on Jul 22, 2003 (gmt 0)

10+ Year Member



I'm using EM instead of pixels for the font size, because of the scaling possibility and flexibility.

Is it advisable to use EM for margin, padding, border, etc.?

Anand

Hester

8:42 am on Jul 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Please DO NOT use ems. Internet Explorer has a terrible problem with them. If the user has their Text Size set to anything beside "Medium", the result is either unreadably small text, or unbelievably big letters.

Check Eric Meyer's website for a solution [meyerweb.com] if you must use ems.

hakre

8:44 am on Jul 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hi 12inch,

it's fairly a question too generic i think. in theory, that might be a good choice, in practise i often choose pixel as sizes for margins etc. and pt for fonts. sometimes even pixel for fonts.

keep in mind that pixel is a relative meassure, too, this sometimes get mixed up by accesability old-schoolers.

-hakre

tschild

10:25 am on Jul 22, 2003 (gmt 0)

10+ Year Member




Please DO NOT use ems. Internet Explorer has a terrible problem with them. If the user has their Text Size set to anything beside "Medium", the result is either unreadably small text, or unbelievably big letters.

That's how setting Text Size is meant to work: letting the user decide on how large they want the text to display. A feature, not a bug.

Nick_W

10:30 am on Jul 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>>A feature, not a bug.

In principle I agree 100% ::: The problems arise when you consider how few people know where the text size settings are though.

Generaly speaking I use ems for fonts and a mixture of percentages and pixels for layout. As long as you don't go below .8em, watch your inheritance and allow plenty of room in your layout you'll not go far wron in my experience...

Nick

Hester

10:50 am on Jul 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That's how setting Text Size is meant to work: letting the user decide on how large they want the text to display. A feature, not a bug.

I agree. But the way it has been implemented is horrendous. Believe me when I say that it makes text set to "Smaller" ridiculously small. The letters become thin lines. Set IE to "Smaller" and you cannot read the text.

Set to "Larger" and half the words don't fit on the screen. Set to "Largest" and you're talking absolutely enormous letters.

Is this what you want for your visitors? In this case it can only hinder them.

Like I said there's a solution if you must use ems.

tschild

11:44 am on Jul 22, 2003 (gmt 0)

10+ Year Member




I agree. But the way it has been implemented is horrendous. Believe me when I say that it makes text set to "Smaller" ridiculously small. The letters become thin lines. Set IE to "Smaller" and you cannot read the text.

Must be a bug in some IE versions, then. I use IE 6.0 and the biggest text size setting differs from the normal setting by a factor of less than 2, as a rough estimate.

Or might it be ca case of inheritance, where the font size for table, tr, td and p are all specified in em and IE applies the text size factor for a text in <table><tr><td><p> four times?

marek

12:00 pm on Jul 22, 2003 (gmt 0)

10+ Year Member



Hester, you can use ems for font-size, but first set the body font-size to 100%. Works fine even in IE/Win.

marek

12:06 pm on Jul 22, 2003 (gmt 0)

10+ Year Member



12inch, paddings and/or margins around larger text blocks should be definitely set in ems to scale according to font size properly.

Hester

12:13 pm on Jul 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hester, you can use ems for font-size, but first set the body font-size to 100%. Works fine even in IE/Win.

Just one solution, being the one given by Eric Meyer. He also gives an example of the BUG in effect, so take a look using the link I gave before. You will then see how devastating this problem can be.

If IE6 allowed pixels to be enlarged we wouldn't have to worry about using them. After all, the screen is made of pixels so we should be using the screen's measurement unit to display fonts. (See Zeldman, Jakob Nielsen et al, who have all written to Microsoft to request they allow pixels to be resized.)

I use pixels but get round the problem by offering an alternate stylesheet with larger fonts. Otherwise I would suggest to anyone concerned about font sizes to download Mozilla or Opera which both allow incremental size increases to be made.

It is a shame that the majority browser - IE - has problems in this area. Luckily IE7 won't be a problem as it's entire window contents can be enlarged smoothly. But you'll have to upgrade to the next version of Windows to get it.

Reflection

4:40 pm on Jul 22, 2003 (gmt 0)

10+ Year Member



Its a simple solution so the IE6 bug is not a reason to avoid em's.

DrDoc

4:43 pm on Jul 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The problems arise when you consider how few people know where the text size settings are though.

So, let's educate 'em ;)

ricfink

6:30 pm on Jul 22, 2003 (gmt 0)

10+ Year Member



I find it odd that so many people take it for granted that text resizing should take place at the browser level.
Why?
Why shouldn't authors be offering text resizing at the page level? I've seen it done in lots of sites.

Hey, I can see the browser providing something crude just in case javascript is not enabled or something but beyond that, why is it IE's job to provide granular resizability?
Or Mozilla's or OPera's or Safari's, for that matter?

tschild

8:16 pm on Jul 22, 2003 (gmt 0)

10+ Year Member




I find it odd that so many people take it for granted that text resizing should take place at the browser level.
Why?
Why shouldn't authors be offering text resizing at the page level? I've seen it done in lots of sites.

One advantage of setting text size at the browser level is that a Web user who can't see well can set the text size to 'large' once, instead of once per site visited.