NYCPHP Meetup

NYPHP.org

[nycphp-talk] Good Font Size Control

Tom Sartain tomsartain at gmail.com
Wed Aug 8 22:19:07 EDT 2007


If you want good font size control, set the font size of your body to 62.5%
This should effectively give you a starting size of 10px. Then you can
use the magic of ems to scale your fonts with pixel perfection.
1.6em gives you 16px font.
1.2em gives you 12px font and so on.

Even though you have font sizing to the pixel, it's still able to be
changed by the browser as desired.

As far as the AAA controls, the easiest way I've seen to do this is to
have alternate style sheets for each font size, then use javascript to
switch between them. I'm hoping you have a few sites to refer to and
figure out the logistics of it all, but that's the basic concept.

On 8/8/07, Michael B Allen <ioplex at gmail.com> wrote:
> Hi Again,
>
> I'm working on a site and I'd like to give the user a little more
> control over the font size throughout the site. Something like those
> "AAAAA" controls on sites that allow the user to select x-large,
> large, regular, small, or x-small. How is that best done?
>
> So far I've just been using <small> and CSS small and x-small.
> Relative values are nice because the user can still change font size
> using their browser (ctrl-+ ctrl-- in FF). But that leaves me somewhat
> at a loss as to how to globally affect the font size. Is there a CSS
> property that can globally increase and decrease the font size
> throughout the entire page? What is the basis for good font size
> control?
>
> Mike
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
>
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php
>



More information about the talk mailing list