Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7602057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:18:57+00:00 2026-05-30T23:18:57+00:00

When 1em is applied to an element, it takes the default value of the

  • 0

When 1em is applied to an element, it takes the default value of the browser (usually, 16px) or the font-size value of its parent, right?. But I noticed that if I use something like margin-top: 1em in a h1 element (without using a reset stylesheet, and therefore, h1 is set to font-size: 32px), then 1em is equal to 32px, even if its parent element is set to font-size: 16px.

However, using something like font-size: 100%; solves the discrepancy.

What am I missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T23:18:58+00:00Added an answer on May 30, 2026 at 11:18 pm

    When 1em is applied to an element, it takes the default value of the browser (usually, 16px) or the font-size value of its parent, right?

    No, it takes its own font-size, computed based on its parent (or the default browser-supplied value). Since the browser-supplied font-size of h1 is 32 pixels, the resultant margin is 32 pixels.

    However, using something like font-size: 100%; solves the discrepancy.

    By setting font-size: 100%; or font-size: 1em; on an element, you’re telling it to use 100% of the font size of its parent, so setting 1em as a length on anything else will follow that 100%.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ive set my fonts specifically as follows * {font-size: 1em;} html {font-size: 125%;} body{font-size:
<div id=content contenteditable=false style=margin:-0.2em 1em; font-family:New Century Schoolbook; font-size:20; color:black; line-height:170%> <span style=margin-left:1.7em>Jenny was
I have css declaration like this #first, #second, #third { font-size:1em; background: url('path/to/image') no-repeat;
var text = '..<anything><anything style=color:red;>hello</anything><anything style=color:blue; font-size:1em;>hello</anything></anything>...'; or var text = ..<anything><anything style='color:red;'>hello</anything><anything style='color:blue;
I've been trying many techniques.. but none helped. I tried margin-bottom: 1em, bottom: 2em,
This problem is only in IE. Consider the following HTML: <html> <body> <div style='position:absolute;left:1em;right:1em;top:1em;bottom:1em;overflow:auto;>
is there any difference on browser between 1.1em and 1.05em ?
font:100 1.1em/37px Tahoma, Helvetica, Sans-serif; What does the 100 mean? font-weight ? What does
I have the following: <table class=floatleft style=margin-right:1em;margin-bottom:1em;border:4px;> Although I have a border around the
Isn't 1em supposed to be 16px across all browsers? I have this CSS *

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.