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

  • Home
  • SEARCH
  • 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 953025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:59:06+00:00 2026-05-15T23:59:06+00:00

We have a CSS file with some rules similar to the following: .directory-result ul

  • 0

We have a CSS file with some rules similar to the following:

.directory-result ul
{
    margin-top: 20px;
    width: 60em;

}

.about-text
{
    margin-top: 1em;
    margin-bottom: 1em;
}

Everything is working ok, but we’re wondering specifically about the inconsistencies between the margin-top values. One is 20px and the other is 1em.

Which is the best one to go with? What are the points I should consider when deciding which to use? Thanks.

  • 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-15T23:59:07+00:00Added an answer on May 15, 2026 at 11:59 pm

    em units are used for better scalability of the page when the size of the elements depend on the page’s scale. It’s especially important for old browsers (e.g. IE6) and mobile platforms.

    px units are used for absolute values, while em is relative to the font size of the particular element.
    1em means one font-line, e.g. you have a box with font-size 12px that means that 1em will be equal to 12px

    Also, using px seems easier because you know the exact value, but em units inherit the value of their container.

    <p>Text</p>
    <div class="box">
      <p>Lorem</p>
    </div>
    
    p {
      font-size: 1.2em;
    }
    
    .box {
      font-size: 1.2em;
    }
    

    In this case, the first <p> will have font-size equal to the basic font-size * 1.2, and the second <p> will display with font-size * 1.2 * 1.2.

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

Sidebar

Related Questions

I have a master page with a .css file with some instructions. Then i
Assume that I have some HTML page, and a corresponding CSS file. I'd like
I have the following rules in my .htaccess file RewriteEngine On #1. home page
I have some rewrite rules in an htaccess file. I'm still getting into it
I have a problem where our CSS file is not playing nice with the
i have a question regarding .htaccess file access for css files and js files
I have some CSS code that hides the cursor on a web page (it
I have a CSS rule like this: background: #fff url('/assets/img/file.png'); It is compiling to:
I have some problems with rewriting URL-s my .htacces file: RewriteEngine On RewriteBase /bsc/
I have 2 CSS files linked in one page. The first file contains formatting

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.