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
https://forums.phpfreaks.com/topic/15378-ems-vs-pxs/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.