July 09, 2009 by Keith Norman
This technique was contributed by one of our campers at Camp Firebelly, Sarah Keane. Here's how it works:
Apply a font-size of 62.5% to the body tag:
body {
font-size: 62.5%;
}
This sets the base font size to 10px, which makes it super easy to figure out how many em's to set for your other font sizes. They will just be taken from a base 10. So 1em is 10px and so forth. For instance, if you wanted to set p tags to 12px:
p {
font-size: 1.2em;
}
Or set your h2 tags to 16px:
h2 {
font-size: 1.6em;
}
Thanks Sarah for the awesome tip!
Also, just an aside for the non-believers that set their font sizes in pixels because it's easier: you are doing a disservice to any of your IE users who want to increase or decrease their browser font size settings. IE does not increase/decrease font sizes that aren't set with a relative sizing (either % or em). This is a major accessibility issue that you should really take the time to fix. Think about it.
recent comments
categories
- Accessibility (2)
- Advertising (6)
- Book Review (5)
- Business (15)
- Camp (4)
- Community (33)
- Design (43)
- Development (26)
- Environmental (17)
- Exhbition (5)
- Fashion (2)
- Film Review (4)
- Film + Video (8)
- Food (2)
- Fun (5)
- Games (3)
- Geocoding (2)
- Health (5)
- Icon Design (1)
- Illustration (2)
- Life (16)
- Motion (7)
- Music (2)
- Philanthropy (17)
- Photography (2)
- Resources (21)
- Shopping (6)
- Socio-Political (32)
- Technology (14)
- Tutorials (10)
- Typography (11)
- Volunteer (4)
- Web Design (18)
archives
- December 2011 (1)
- November 2010 (1)
- June 2010 (1)
- March 2010 (1)
- February 2010 (1)
- January 2010 (2)
- November 2009 (9)
- October 2009 (14)
- September 2009 (7)
- August 2009 (9)
- July 2009 (11)
- June 2009 (7)
- May 2009 (10)
- April 2009 (9)
- March 2009 (16)
- February 2009 (15)
- January 2009 (14)
- December 2008 (9)
- November 2008 (17)
- October 2008 (11)
- September 2008 (1)
- August 2008 (9)
The Daily Do-Gooder is out! http://t.co/eGyENLlr ▸ Top stories today via @govoluntr @bstatements @ndinm @sabinevatel @nynjgoodwill
+ 2 days ago
Photo: **** pleasant house is perfect. Mushroom & kale pot pie. http://t.co/0lQxmLkm
+ 6 days ago
We're hiring! Experienced web/ux designer... we want you! - http://t.co/lKSyrwZe
+ 9 days ago

























