Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
|
One thing you can do is uses em instead of %, in a way that will exactly imitate px sizes at default browser font settings. It works like this:
CSS
Code:
body {
font-size: 62.5%;/*this becomes the parent size for the entire document*/
}
Now, any pixel size expressed em will be equivalent to the px quantity one decimal place over. In other words, 1em is equal to 10px at default browser font settings:
Code:
p {
font-size: 1.1em; /*same as 11px*/
}
The advantage of sizing fonts this way is that they may now be re-sized by the user. This same principal may be used for anything, not just font-size, but you must remember, em is proportional to the parent, which means you must be careful.
Last edited by wayfarer07; 11-06-2009 at 04:07 PM..
|