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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:22:10+00:00 2026-05-12T18:22:10+00:00

My basic CSS rule for font-size and line-height is pretty simple: body { font-family:

  • 0

My basic CSS rule for font-size and line-height is pretty simple:

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 24px;
}

When I create a paragraph that contains an <em> or a <strong> (or even some <code> which uses a different font-size than the <body>), I notice that these elements increase the line-height by a pixel or two.

This leads me to believe that most browsers take the largest inline element to display line-height. Is that right?

My goal is to make the line-height consistent, regardless of which elements are inline.

The only way I’ve found to make the line-height consistent is to define:

em, strong, code, etc {
    line-height: 100%;
}

Is this the right way to go about this? Or am I being too much of a perfectionist?

Edit 1:

This also seems to work:

em, strong, code, etc {
    line-height: 1;
}

Edit 2:

After playing with this for a few days, it doesn’t appear that there is a reliable solution for keeping a consistent line-height. If anyone has any ideas, I’d certainly love to hear them.

Edit 3:

For my own future reference and from my own research, these tags should be considered with line-height: 1 as long as they are displayed inline along with other standard body text:

abbr, acronym, b, big, cite, code, del, dfn, em, i, ins, kbd, q,
samp, small, strong, sub, sup, tt, var

These elements are questionable:

a, bdo, img, span
  • 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-12T18:22:11+00:00Added an answer on May 12, 2026 at 6:22 pm

    The spec confirms what you thought, that browsers take the largest font for the line-height calculation. That means your only option (and the one the spec mentions) is to set the line height for ALL the inline boxes on lines you care about. You probably would not be happy with the results of selecting body * and setting the font size. So add some Divs with the same class around whatever blocks of text you want to look uniform, and there you go:

    div.uniformlines * { 
        line-height: 100%;
        font-size: 16px;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is probably a basic html/css question... I have a simple one-button form that
I have some pretty basic HTML/CSS that isn't working as I expect. Basically I
what basic tips should we observe in design web pages(html/css/javascript) for having highest compatibility
I'm not expert about css menus. But I know basic system to make css
I need some basic css help. I attempted to style the cells of a
I have some basic CSS on a table and I cannot get a border
I must be missing something very basic in the CSS. My jQuery anchor button
This might be a basic CSS question: I have a site designed with well-defined
I have a basic CSS question. I have a list, but I can't get
I'm currently running in circles with my actually very basic CSS. I am writing

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.