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 (14)
- Camp (4)
- Community (32)
- Design (43)
- Development (26)
- Environmental (17)
- Exhbition (4)
- Fashion (2)
- Film Review (4)
- Film + Video (8)
- Food (1)
- Fun (4)
- Games (3)
- Geocoding (2)
- Health (5)
- Icon Design (1)
- Illustration (2)
- Life (14)
- Motion (7)
- Music (2)
- Philanthropy (16)
- Photography (2)
- Resources (21)
- Shopping (5)
- Socio-Political (32)
- Technology (14)
- Tutorials (10)
- Typography (11)
- Volunteer (4)
- Web Design (18)
archives
- 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)
Twitter feed is temporarily down!

























