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 7908467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T11:56:53+00:00 2026-06-03T11:56:53+00:00

In CSS, an em is a relative unit based on the font-size of the

  • 0

In CSS, an em is a relative unit based on the font-size of the document. So, what exactly is an em then, if the font-size of the document itself is measured in ems? Suppose we say:

<style type = "text/css">
body
{
    font-size: 1em;
}
</style>

So, an em is now recursively defined. So how is this handled by the browser?

The W3C docs say:

The ’em’ unit is equal to the computed value of the ‘font-size’
property of the element on which it is used. The exception is when
’em’ occurs in the value of the ‘font-size’ property itself, in which
case it refers to the font size of the parent element. It may be used
for vertical or horizontal measurement. (This unit is also sometimes
called the quad-width in typographic texts.)

But what if the element is document.body, so there is no parent element?

  • 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-06-03T11:56:55+00:00Added an answer on June 3, 2026 at 11:56 am

    body is not the document root element — that’s a very common misconception. The parent element of body is html, whose default font size matches the browser’s default font size setting (typically 16px).1

    This applies even if you set a font-size value in ems on both body and html. So if you did this:

    html, body { font-size: 2em; }
    

    Then, assuming a default font size of 16px as set by the user, html will have a font size of 32px (twice the default font size) and body will have a font size of 64px (twice of its parent, html).


    1 To be precise, the html element’s default font size is the initial value, medium, which according to the spec corresponds to the preferred default font size as set by the user.

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

Sidebar

Related Questions

My Css #container{ display:block; } #container ul{ list-style:none; position:relative; margin:0px; padding:0px; display:block; } #container
I am learning CSS, and was reading questions about Relative vs Absolute font-sizes on
I want to position an element in normal css relative to the element before
I have a <div id=outer> which has the following css: position:relative; width:300px; height:125px; float:left;
I have a container div with the following CSS: #container { position:relative; overflow:hidden; width:200px;
I have the following CSS rules applied to a DIV: .icon { position:relative; display:
Have been using a simple CSS only tooltip. Working Example css: .tip { position:relative;
Hy, i have a div with relative position (CSS) and i want to make
What's wrong with this? $(#tag_square).appendTo('#edit-area img').css({ position: relative, left: 100px, top: 10px, z-index: 2});
As you can see in the CSS below, I want child2 to position itself

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.