PDA

View Full Version : CSS: Which is better?



Cagez
April 22nd, 2003, 15:57
I'm working with someone who says that in CSS, you should define font-sizes as percentages, I've never done this before and never seen anyone else do it so I was wondering if I should start using percentages?

I usually use xx-small, small etc as my sizes so browsers can make them bigger if the user wants (like in IE->View->Text Size), if I use pt or px they can't.

Anyway, here is an example of what I mean:



.thisfont {
font-size: 80%;
}

.thisfont {
font-size: x-small;
}


So, which should I use? Its not that I don't believe the guy, just want to back it up ;) :p

manni
April 23rd, 2003, 04:00
I think you should specify font-size (http://www.htmlhelp.com/reference/css/font/font-size.html) in points/pixels (http://www.htmlhelp.com/reference/css/units.html#length). The font size looks the same in every CSS supporting browser and they scale up (getting bigger) when using zoom funtion in browsers.

zoobie
April 23rd, 2003, 05:08
Originally posted by manni
The font size looks the same in every CSS supporting browser...

Au contrare...Guess again. :biggrin2:

Just use the non-css size=2 if you want them to be able to change it. :bandit2:

manni
April 24th, 2003, 03:15
Originally posted by zoobie
Just use the non-css size=2 if you want them to be able to change it.Just realized it's so. Mozilla and Opera zoom function resizes text, IE doesn't.

zoobie
April 24th, 2003, 05:23
Huh :confused: Using size=2, you have always been able to go to file>view>text size to resize the text in IE...

manni
April 24th, 2003, 05:36
I was talking about pixel sized fonts. size=2 font zooming works in ie...