By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,738 Members | 1,114 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,738 IT Pros & Developers. It's quick & easy.

Pixels Per Em

P: 2
hi

i am website designer. i am always confuse with em in css. can u tell me that 1 em = how much pixel.
Expand|Select|Wrap|Line Numbers
  1. div.test {
  2.         width:10.2em;
  3.         position:absolute;
  4.         top:0;
  5.         font-size:11px;
  6.         padding-left:1%;
  7.         padding-right:1%;
  8.         margin-left:0;
  9.         margin-right:0;
  10. }
  11.  
can u describe me width in pixel. 10.2 em is how much in pixel?

thanks
bindi
Feb 21 '07 #1
Share this Question
Share on Google+
3 Replies


Expert 100+
P: 1,892
hi

i am website designer. i am always confuse with em in css. can u tell me that 1 em = how much pixel.
Expand|Select|Wrap|Line Numbers
  1. div.test {
  2.         width:10.2em;
  3.         position:absolute;
  4.         top:0;
  5.         font-size:11px;
  6.         padding-left:1%;
  7.         padding-right:1%;
  8.         margin-left:0;
  9.         margin-right:0;
  10. }
  11.  
can u describe me width in pixel. 10.2 em is how much in pixel?

thanks
bindi
Check out this article some I think you can find the answer you're looking for.
Feb 22 '07 #2

P: 1
by default 1 em is equal to 16px but you can define size as u need in <body>

for example i need to fix 1 em is equal to 10px

body{

margin:0;
padding:0;
font-size:62.5%
}

16px's 62.5% is equals ti 10 px

so now it will b like E.g

div#heading{

margin-top:0.5%;
padding-top: 1em;
font-size:1.8em;
}

the above example shows that margin-top: 5px, padding-top:10px and font size 18px. i hope this will help you. let me know if you have other questions
email me qais@astutesol.com
Nov 13 '09 #3

drhowarddrfine
Expert 5K+
P: 7,435
A couple days ago, I saw someone answer a question from 3 years ago.
Nov 13 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.