CSS - how can I handle the size difference between serif and sans-serif fonts?

Posted by orbit82 on Stack Overflow See other posts from Stack Overflow or by orbit82
Published on 2010-04-20T03:20:46Z Indexed on 2010/04/20 3:23 UTC
Read the original article Hit count: 328

Filed under:
|

I'm working on a WordPress that will allow the site administrator to switch between sans-serif and serif fonts.

I'm trying to code the stylesheet in such a way that the font sizes are similar whether or not they choose Georgia vs Arial.

The problem is that when I have it looking nice with a serif font, it looks WAY too big when in sans-serif. When I then adjust it to look nice in a sans-serif font, it looks WAY too small in serif.

Is there an ideal font size and line-height that works well with both serif and sans-serif?

Or do I need to make separate stylesheets (a serf version and a sans-serif version)?

P.S. I've set a base font size on the body at 12px, and then set the rest of the font sizes as a percentage of the base. Of course, this base font size could be set in ems or in percent, because the percentages will still scale proportionally.

© Stack Overflow or respective owner

Related posts about fonts

Related posts about css