Archive for the ‘quick tip’ Category

Quick Tip #1 – Tame those ems

Wednesday, January 21st, 2009

If you are into em-based layouts, you probably want more precision when translating your photoshop designs into pixel-perfect HTML and CSS creations. Simply setting the font-size in your body element to 62.5%, will make sure that from now on, you can rely on the rule of 1em = 10 pixels.

body {
	font-size: 62.5%; /* 1em = 10px */
}

Note: Careful if you modify the font-size on a container element – that will break the 10px rule on all the contained elements!