Coming from a print background I am used to using pt, however all the articles I've read said em is the way to go.
Is there a reason to use em over pt?
Is there a reason to use em over pt?
I tried to use a pt to em convertor, and the text on the site I'm working on got real small (10pt = 0.8em?)
Is that about right?
I tried to use a pt to em convertor, and the text on the site I'm working on got real small (10pt = 0.8em?)
Is that about right?
I just realized that you have been saying point and not pixel, so I'm not quite sure how closely they relate.
A normal base font size of 16px equals 1em. Em's are a ratio compared to what you set the default text size as, so 1em could be visually equivalent to 25pt size, if you set your base text size to something like 25px... It's relative, see?
Oooooo ok, that sounds reasonable
How would I go about setting 1em = to 10pt?
10pt is roughly 13px and 16px is roughly 12.3pt
Can we agree to start referring to 10px as points of printing doesn't exactly correlate? It will allow everyone to be on the same page for the remaining discussion.
I think the idea is that the scale is set by the default browser font size, which in most cases is 16px. There is no way you can change a browser's default size. I read a nice article somewhere about setting up what you want em's to equate to in your coding, but I can't recall where that was.... I just spent 5 minutes retracing my fav dev links and still couldn't find it.
16px base / 10px desired font size = .63em.
so for your 13px desired hight, it would go like this:
16px base / 13px= .81em
But I don't think you should even be bothering with "point" sizes. Web can't directly match your print world aesthetics. Decide what looks good on screen in physical pixels, and describe that with ems.
From my quick skim that seemed to be an informative article.
But you can't help but get a sort of twisted smile of pain/entertainment viewing that page.![]()
Ok ok, I've been converting all my pts I use into ems with a 1em equaling 16 px. Maths, bleh.
Anyway, something can't be right because when I tell my H1 tags to be 1.3em in size, they look way smaller than 16pt/20.8px using previous sizes.
Compare the attached image with www.favoritestaffing.com and look at the text.
#content{ font-size: .9em; }
p { font-size: .9; }
Is there a reason to use em over pt?
Well my boss doesn't want the page to scale, she wants it hard-coded pixel by pixel. Oh well, I did go ahead and convert my pt to px, just for consistency sake
But this has been a useful experience and I learned alot.
Of course, if you use ALL em, and never refer to any explicit px heights, and if the browser has its default font size set to something reasonable for the screen, then it'll work anyway. So maybe even then we'll stay with em and it'll just be more important than it is now.