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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:13:25+00:00 2026-05-10T22:13:25+00:00

One CSS rule I have learned is that you should use the relative em

  • 0

One CSS rule I have learned is that you should use the relative ’em’ font-size unit instead of the absolute ‘pt’. The general idea is to set the font-size in your body tag to e.g. ‘94%’ and then set all other elements with an ’em’ size like this. The reasoning is:

  • you can then change the relative size of all the font sizes on your site by modifying the body’s font-size at one point
  • users themselves can modify the size of the fonts since they are defined in ’em’

However, when using ’em’ instead of ‘pt’ I constantly run into issues such as the following where an element with font-size gets embedded in another element with font-size and thus becomes tiny (in the case below one vocabulary word is .8 of .8 and the other is .8 of 1.2).

<html> <head>     <style type='text/css'>         body {             font-size: 94%;         }         p {             font-size: .8em;         }         li {             font-size: 1.2em;         }         .vocabulary {             font-size: .8em;         }     </style> </head> <body>     <p>This is an <span class='vocabulary'>egregious</span> test.</p>     <ul>         <li>This is in a <span class='vocabulary'>superb</span> list.</li>     </ul> </body> </html> 

Of course in very simple, straight-forward HTML sites this is no problem, but in the real world with imported stylesheets that perhaps you didn’t even make and with dynamic sites where controls are embedded in other controls all of them outputting HTML with perhaps in-line styling, I find websites with ’em’ unit font-sizes are sometimes impossible to maintain and the way to get font-size under control is to just convert everything to hard ‘px’ sizes.

In addition, I just checked the four main browsers and each of them have hotkeys which increase and decrease the size of ‘pt’ styled fonts.

So here are my questions:

  • is there any real-world reason why I should use ’em’ instead of ‘pt’?
  • is there trick in using ’em’ sizes so that I don’t run into the embedded font-size issue above?
  • 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. 2026-05-10T22:13:26+00:00Added an answer on May 10, 2026 at 10:13 pm

    Depending on the country where you live, you might actually end up breaking the law using pt instead of em, depending on how hard your legislature want to enforce rules. Here in the UK, there is a disability discrimination act, which has been used to target companies where their websites have been rendered in a fixed font. This is treated as discrimination because it disadvantages the partially sited who may have increased their browser font sizes to compensate – but your site still renders fonts at the size you set, and not at the size they would expect.

    Yes, it’s harder to get to grips with relative font-sizes and fluid layouts, but if you want to comply with legislation, you have to take the time to get to grips with this.

    For local government work in the UK, targets have been set to ensure that websites follow Double A guidelines, one of which states ‘Use relative rather than absolute units in markup language attribute values and style sheet property values’. See here.

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

Sidebar

Ask A Question

Stats

  • Questions 123k
  • Answers 123k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer How about: NSString *newString = [NSString stringWithFormat:@"'%@'", mystring]; May 12, 2026 at 1:00 am
  • Editorial Team
    Editorial Team added an answer Found I can make the socket available outside the thread… May 12, 2026 at 1:00 am
  • Editorial Team
    Editorial Team added an answer MVC is unrelated to data access. If you're wondering whether… May 12, 2026 at 1:00 am

Related Questions

When coding new javascript heavy websites, which order or web browser do you code
Suppose I have the following CSS rule in my page: body { font-family: Calibri,
I have two divs. I want one with id hor_rule to appear beneath the
I have been looking at a hack to solve a CSS problem I have.

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.