Solved

css

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

710 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