?
Solved

css

Posted on 2012-04-09
4
Medium Priority
?
199 Views
Last Modified: 2012-06-27
Hi,

What is the differnce between em, px and % ?
which one of the three maintains consistent design across browsers and resolutions?
0
Comment
Question by:genius_geek
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 12

Assisted Solution

by:Pra4444
Pra4444 earned 300 total points
ID: 37823597
Here is a good explanation on what you are looking for...

http://kyleschaeffer.com/best-practices/css-font-size-em-vs-px-vs-pt-vs/
0
 

Author Comment

by:genius_geek
ID: 37823634
thanks. not only font size. I am talking in general. for instance, width or margin or etc or whatever...they all can be specified in px, em or % and i want to know which is a standard way?
0
 
LVL 16

Accepted Solution

by:
s8web earned 1200 total points
ID: 37824163
There is no standard way per se. Just different ways. Px or pixels is a very specific amount of space, measured in pixels. Designs that are 'pixel perfect' usually have most elements specifically defined in pixels. Most fluid layouts utilize em or %. Percent is the amount of space the element should take up with reference to its parent container. If there is no parent container, it uses the size of the users screen. Em is the width of the character M. It is very useful, but a holdover from printing. There are many different methods. Personally, I like to define the parent container and base font in pixels, then use percent and em for everything else. If I want to scale the design later, which a almost never do, you only have to change the parent.
0
 

Author Comment

by:genius_geek
ID: 37826133
thanks s8web. it was really informative. I might just try your style, parent in pixels and rest in percent. Do you think following this style will make any difference if the users have different screen resolutions?

my entire idea behind starting this discussion was to find a way to design page/form elements such that they appear same across different screen resolutions.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question