/    Sign up×
Community /Pin to ProfileBookmark

How much is 2em in 1024x768px display?

I would like to know how much is em in terms of px in case of common parent like code:

[code=html]
div {
padding: 0 0 0 1em
}
[/code]

Can I calculate px padding from this if I have within body the following:

[code=html]
body {
line-height : 140%;
margin-top : 20px;
}
[/code]

to post a comment
CSS

1 Comments(s)

Copy linkTweet thisAlerts:
@KDLAAug 17.2009 — It depends on the browser. Fx tends to equate 1em to 14px; IE's is a little larger at 16px.

What I do, is put a base of 10px in the body, so that all em sizes are easily calculated:
<i>
</i>body {font-size: 10px;}
p {font-size: 1.2em;} /*equals 12px*/
div {font-size: 1.5em} /*equals 15px*/
×

Success!

Help @toplisek spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...