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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:42:05+00:00 2026-06-04T14:42:05+00:00

Are there any drawbacks(browser/device inconsistency…) in specifing line height without unit? Example: body {

  • 0

Are there any drawbacks(browser/device inconsistency…) in specifing line height without unit?

Example:

body {

    line-height: 1.5;
}
  • 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-04T14:42:07+00:00Added an answer on June 4, 2026 at 2:42 pm

    In most cases, it’s actually better to use unitless line-height – see

    • http://meyerweb.com/eric/thoughts/2006/02/08/unitless-line-heights/
    • https://developer.mozilla.org/en/CSS/line-height – see the notes where they show an example

    Of course, there are exceptions. The first one that comes to mind is when you have a block element with a known height and with one line of text in it and you want to center that line of text vertically – I find that the easiest way to do that is to use a line-height that’s equal to the height of the block element.


    [Just in case, for anybody who doesn’t know what’s the deal with unitless line-height.]

    Suppose you have an element with font-size: 14px. It doesn’t matter where it was set, whether it’s inherited or not, if you set it yourself or it came from the user agent stylesheet. The element has font-size: 14px.

    Now, if you set, let’s say line-height: 1.5 for the same element, this will be translated into pixels as 1.5 * 14px = 21px. So your computed line-height will be 21px.

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

Sidebar

Related Questions

Are there any drawbacks / disadvantages using the default constructor for default initialization for
I was wondering if there were any real drawbacks associated with using LOGO? I
Are there any drawbacks to such a configuration?
Are there any drawbacks if you use setLayout(null) for say JFrame and use setBounds
Are there are any drawbacks of using Heroku as the primary Git repo -
I am curious to know if there are any drawbacks or limitations of using
Are there any drawbacks to having a symbol with external linkage (other then global
Is there any drawback (except allowing the value or array to grow too large)
Is there any drawback to this setup? I want to be able to run
Is there any cost/drawback (apart from typing too much) to adorning a class with

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.