Skip to content

pixel , em and % usage

September 14, 2011

All of the measurements have their own purposes:

Use pixels for pixel-based things, like borders. You probably don’t want a border that ends up being 1.3422 pixels wide.

Use text-centric measures (em, ex) for text-based things, like content areas, labels, and input boxes. It’s an easy way to make sure you have room for text of a certain length and width.

Use percents for window-based things, like columns.
There are exceptions, of course. For example, you might want to specify a minimum column width in pixels. But follow the above and your pages will scale well. ALWAYS zoom in and out on your pages to see how they work with different font sizes and browser shapes — don’t get surprised later.

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: