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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:12:16+00:00 2026-06-04T02:12:16+00:00

I have encountered an issue with Firefox that if border-box is applied to an

  • 0

I have encountered an issue with Firefox that if border-box is applied to an image, a gap is created on the right side.

<div id="sl">
  <img class="der" src="https://www.google.com/logos/2012/francois_truffaut-2012-hp.jpg"/>
</div>
#sl
{
  background-color: #ff0;
  display: inline-block; 
}

body
{
  background-color: #f00;
}

.der
{
  height: 60px;   
  display: block;
  border: 1px solid #00f;
  -moz-box-sizing: border-box;
}

Firefox only: http://jsfiddle.net/r2GLU/

The question is why is this behavior? I guess that border-box shouldn’t have been applied on image in the first place, but I don’t think that it is forbidden either and Firefox is the only one who has problems.

  • 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-04T02:12:17+00:00Added an answer on June 4, 2026 at 2:12 am

    I think you’ve encountered a bug in Firefox. The original, un-resized image is 163px high by 421px long.

    Now, looking at the computed styles in Firebug, the img has these values (I’ve added comments showing how they were computed):

    height: 58px;      /* img-height = box-height - box-border = 60 - 2 = 58 */
    width: 149.8px;    /* img-width = img-height * aspect-ratio = 58 * (421 / 163) = 149.8 */
    

    And the div has these values:

    height: 60px;      /* div-height = img-height + box-border = 58 + 2 = 60 */
    width: 156.967px;  /* div-width = div-height * aspect-ratio + box-border = 60 * (421 / 163) + 2 = 156.967 */
    

    The bug is that last computation. It should have been:

    width: 151.8px;  /* div-width = img-height * aspect-ratio + box-border = 58 * (421 / 163) + 2 = 151.8 */
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently encountered a printing issue in Firefox that eventually turned out to be
I have recently encountered an issue that is related to code running in the
I am implementing instrumentation within an application and have encountered an issue where the
I have encountered a most annoying problem that occurs on the PWD variable when
I have encountered a problem in my application. I have two forms, one that
Recently I have encountered an issue with Scribd where searching via Scribd API (docs.search)
i have encountered a very strange issue: i use json.dump to write a file
have anyone encountered the issue wherein using a dynamic textfield without embedding fonts causing
having an issue supporting IE6 (meh).. I have an update panel that is triggered
I have encountered strange issue with lists in F#. I am using XamlXmlReader to

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.