Solved

css

Posted on 2012-04-09
4
167 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
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…

895 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now