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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:35:11+00:00 2026-06-12T05:35:11+00:00

How can I force line height in CSS, in such way that no big

  • 0

How can I force line height in CSS, in such way that no big letters will stretch the line height. Instead, they should clip under the above line, or even merge with the above line.

CSS line-height seems to work like MS Word’s “at least” line height option by default. I want to make it work like MS Word’s “exactly” option.

For example:

  • http://jsfiddle.net/DUpgN/

There, the lines aren’t the same height, because one line has some bigger letters in it. I want all lines to be the same height regardless.

  • 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-12T05:35:13+00:00Added an answer on June 12, 2026 at 5:35 am

    Glyphs (the visual representations of a character) are centered
    vertically within an inline box. If the line height is larger than the
    content height, half the difference is added as space
    at the top; the same amount is also added at the bottom.

    That’s the case for the main, non bold, text in your example.

    When set on a non-replaced inline element, it specifies the height
    used to calculate the height of the surrounding line box.

    So in the bold text, you’ll still have 8.5px above the font-size, which causes the issue.

    You can prevent it by setting a line-height smaller than the font-size ( check this demo ). As it’s an inline element, and there’s no overflow:hidden; it will still be enterely visible, but it won’t add any pixel to the rest of the text’s line height.

    As far as i know, it’s not possible to “stretch” the letters, unless you use some CSS3 properties like transform:scale(value) etc.

    Reference


    Code:

    <p>ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac <b>ac</b>
    ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac</p>
    

    ​
    CSS:

    p {
        line-height:17px;        
        font-size:15px;
        width:150px;
    }
    b {
        font-size:25px;
        line-height:1px; 
    }​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way I can force a floated div to shrink instead of
Hi I want to make a small test window app that can force IE
Using Castle ActiveRecord / NHibernate: Is there a way you can force an ICriterion
can I force the DBML designer to use my custom types instead of the
How can I force validation when user clicks button? One would think this should
I know that you can force GPU acceleration to achieve smooth animation of elements
How can I force flex to cuddle my curly-braces instead of putting them on
Possible Duplicate: CSS: how can I force a long string (without any blank) to
On Visual studio I can force use of 32-bit time_t by declaring _USE_32BIT_TIME_T .
I've been trying to figure WIF out for a while now, and can force

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.