PDA

View Full Version : Font Style !


spazzer
11-04-2009, 11:31 AM
Hi,

I have declared font-size 62.5% in my body tag, am I better to include a base font style in the body tag or should I style each div separately for more flexibility ?
Any help would be appreciated !!! :grin:

Corrosive
11-04-2009, 12:02 PM
I tend not to bother having a base font size any more because I always end up over-riding the CSS but I'm sure someone will be along to tell us it is 'good practice' or something to have it, lol.

DWcourse
11-04-2009, 07:28 PM
I find it convenient to declare a base font-size and, if you use ems for your font sizes, I believe you need to declare a font-size as a percentage in the body tag to avoid some stupid IE bug.

I'd be more concerned about the 62.5% size. I think that translates to 10 pixels and that's too small for my old eyes.

Ricky55
11-05-2009, 01:46 AM
If i am are using em's I always declare a font-size of 100% as this gives you a 16 pixel default to base all your other sizes from.

So then if you made a font-size: 1.25em it would be 20 pixels for example.

d a v e
11-05-2009, 03:18 AM
but, if you use 62.5% then you can use ems that are equivalent to pixel sizes: so 2.4em on h1 would be 24px, and so on; makes it easy to use the classic scale (i know it's in points but it works when you substitute px)
# 6pt: nonpareil
# 7pt: minion
# 8pt: brevier or small text
# 9pt: bourgeois or galliard
# 10pt: long primer or garamond
# 11pt: small pica or philosophy
# 12pt: pica
# 14pt: english or augustin
# 18pt: great primer
# 21pt: double small pica or double pica
# 24pt: double pica or two-line pica
# 36pt: double great primer or 2-line great primer

spazzer
11-05-2009, 09:04 AM
Thats right Dave thats exactly why I have done it so that 1em will equal 10pixels ,if as in most browsers 16 pixels is the default value !

Cheers,
Nick C ;-)

DWcourse
11-05-2009, 01:12 PM
That's a good trick. It handn't occurred to me that's what you were doing. And I've seen so much small type online that I jumped to a (wrong) conclusion. Although, at that point, why not just use % throughout so 24%=24 pixels?

d a v e
11-05-2009, 02:31 PM
because 24% would be a quarter of the base font size - so if you wanted 24px from 24% base font size would have to be 100px :)

DWcourse
11-05-2009, 04:57 PM
because 24% would be a quarter of the base font size - so if you wanted 24px from 24% base font size would have to be 100px :)

DOH, I must have been drinking when I did that math! (or you could set the base font to 625%)