Solved

css

Posted on 2012-04-09
4
192 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 100 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 400 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Unordered lists (HTML ul tags) are very handy to create menus of all types, shapes and sizes.  All it takes is a little knowledge of CSS and the possibilities are endless. First off, you should know the general format for menus created using the …
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

623 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