em vs pixels

This is a discussion on "em vs pixels" within the Web Page Design section. This forum, and the thread "em vs pixels are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Nov 14th, 2006, 18:21
Reputable Member
Join Date: Dec 2005
Location: Texas
Age: 19
Posts: 328
Thanks: 0
Thanked 0 Times in 0 Posts
em vs pixels

What is the difference between em and pixels? If you dont understand take a look at this codeing.

Code: Select all
margin-left: 1em;
or
margin-left: 50px;
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Nov 14th, 2006, 19:24
Junior Member
Join Date: Nov 2006
Location: Los Angeles
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Re: em vs pixels

http://www.bigbaer.com/css_tutorials/css_font_size.htm

EM is a relative measure that is based on whatever font you specify. You can think of 1em as having a size equal to the space subtended by a capital "X". So, a width of 4em in verdana (the font i am typing in right now) would look like this:

XXXX

Pixel is an absolute measure based on, you guessed it, the pixels subtended by a character.

Good web designers take care to control both absolute and relative font specifications. First and foremost, you should make sure your font sizes throughout a site are relative to one another. This is more flexible bc it allows you to change the size of the font while preserving the proportionality.

The other question you must answer is:

How do you initially specify a font size at the root level of the site? Should you use absolute or relative?

That depends on what you're trying to accomplish. You can specify an absolute pixel size as the parent font size and then, provided all other font sizes on the site are relative, any changes you make to that one parent font size will propagate throughout the site and remain proportional.

Or...

You can specify a relative value as the parent font size, which leaves the decision up to the user's browser defaults. This method is more flexible because it accommodates for all types of browsers but is less consistent in visual layout.

I generally don't trust my users that often and tend to specify a fixed parent font size coupled with proportional body font sizes.

Hope this helps.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Nov 14th, 2006, 20:25
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Re: em vs pixels

You will find some info on this in the sticky at the top of this forum.

Have a read and come back if you have more questions.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Nov 17th, 2006, 08:43
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
Thanks: 0
Thanked 0 Times in 0 Posts
Re: em vs pixels

You can use ems to make <div>'s that shrink or expand depending on the text size set by a browser as well. Fun stuff.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
pixels

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Appending "..." after so many pixels in a string RooZ Web Page Design 7 Jan 24th, 2008 18:00
White pixels appearing in image (IE only) JennyChaos JavaScript Forum 7 Jul 20th, 2007 12:12
Resizing (in pixels) danburzo Graphics and 3D 2 Jun 19th, 2005 11:06


All times are GMT. The time now is 14:08.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved