PDA

View Full Version : Font size - em, px or %



KevinG
May 26th, 2007, 06:02 PM
Whats the best rule to use when deciding font size? I have always used pixels but today a friend said use %?

another reason i am asking is because i anxious to find out what happens if someone enlarges my text and the div around the text can't show it as it is not big enough - is there a work around for this (aside from making a larger div?), e.g can i make a auto size div?

_Aerospace_Eng_
May 26th, 2007, 06:17 PM
I've found the best solution for things like this is to use em for widths and/or heights. If the text is resized the element will also resize accordingly. A good example is this site
http://www.klproductions.com/
It belongs to vladdy on the forums. Resize the text and notice how everything resizes according to the text size.

If you use px or pt IE users won't be able to resize their text but any other browser will be able to.

KevinG
May 26th, 2007, 08:09 PM
thanks aero, so your saying use em's for the divs and text?

_Aerospace_Eng_
May 26th, 2007, 09:49 PM
Yes thats what I'm saying. If its okay for text to go to more than one line then just be sure not to set a height on the element.

KevinG
May 27th, 2007, 08:38 AM
:thumbsup: thanks as usual aero, i'm off to 'em' everything.