|
davidrandall -> Converting to em's (6/9/2006 10:42:02)
|
Wasn't sure whether to put this here or in accessibility as it covers both. I always use a relative font size (that can be scaled) on my sites which poses a problem when a client sends their brand guidelines with fonts specified in pixels or points. This makes using percentages very difficult for font sizes as it's pretty much trial and error to see what looks right. For this reason I now use em's. Ems are relative to the font size defined in the parent container or, if there isn't one, the browser's default. Therefore 1em is equivalent the the base font size. 2em is twice that size. As a default, a browser's font size is set at 16px so 1em = 16px. That's not a very managable number so I set the base font size to 10px. 10px/16px = 0.625 so 10px is 62.5% of 16px I set the font size on the <body> tag to 62.5%. This makes the default font size for the website equivalent to 10px. 1em now equals 10px, 1.6em = 16px and so on. Dave
|
|
|
|