Jump to content

ems vs pxs


spyke01

Recommended Posts

i am redesigning my current site with more css and JS, and wanted to see what the big difference is between ems and pxs. is there a way to make  1em=1px? the reason i ask is because i like the control i have with pxs, if i cant make them the same, or its not a good idea, then can someone help me with this:

Ok we have this box:
+----+----------+
|      |              |
|      |              |
|      |              |
+----+----------+

It is 900px wide, the left column is 200px and the right 700px, we want 2px padding all the way around, so our css is like this:
[code]
#box {
    width: 900px;
    padding: 0px;
    margin: 0px;
}

#left-col {
    width: 196px;
    padding: 2px;
}

#right-col {
    width: 696px;
    padding: 2px;
}
[/code]

how does this relate in terms to ems if our default text is this:
[code]
body {
font-family: Helvetica, Tahoma, Verdana, Arial, sans-serif;
font-size: 12px;
}
[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.