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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:45:39+00:00 2026-06-16T09:45:39+00:00

Say I have a single span element defined as an inline-block. It’s only contents

  • 0

Say I have a single span element defined as an inline-block. It’s only contents is plain text. When the font size is very large, you can clearly see how the browser adds a little padding above and below the text.

HTML:

CSS:

span {
  display: inline-block;
  font-size: 50px;
  background-color: green;
}

​
<span>BIG TEXT</span>

Looking at the box model, it’s clear the browser is adding padding inside the content edge. I need to remove this “padding”, one way is to simply alter the line-height, as with:

http://jsfiddle.net/7vNpJ/1/

This works great in Chrome but in Firefox the text is shifting towards the top (FF17, Chrome 23, Mac OSX).

Any idea of a cross-browser solution? 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-06-16T09:45:40+00:00Added an answer on June 16, 2026 at 9:45 am

    It appears as though you need to explicitly set a font, and change the line-height and height as needed. Assuming ‘Times New Roman’ is your browser’s default font:

    span {
      display: inline-block;
      font-size: 50px;
      background-color: green;
      /*new:*/
      font-family: 'Times New Roman';
      line-height: 34px;
      height: 35px;
    }
    <span>
        BIG TEXT
    </span>
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have an array of arbitrary size holding single characters. I want to
Say I have a very simple html page, containing a single line of text.
I have a single hexadecimal character, say char c = 'A'; What's the proper
Say I have a.so and b.so. Can I produce c.so as a single shared
Let's say you have a database with a single table like... --------------------------------------------- | Name
Let's say I have a button.. how can I distinguish between single click and
Say i have an single dimension array (to keep it simple). Is there a
Here is my code (Say we have a single button on the page that
Let's say I have the simplest single-file Sinatra app. The hello world on their
I have a form and multiple controls. Say I have a single form and

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.