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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:59:40+00:00 2026-06-09T16:59:40+00:00

I’m having a problem with percentage based layout. Here is my code http://jsfiddle.net/uHkXH/ If

  • 0

I’m having a problem with percentage based layout. Here is my code http://jsfiddle.net/uHkXH/

If your are using Safari or Opera on Mac, or IE7 on Windows, or iPhone iPad you will see a gap on the right side. But the width, padding and margin of four boxes should be 100% in total. I cannot understand why there is still a gap.

Does anyone can explain this problem and help me to solve it? Thank you very much indeed!

  • 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-09T16:59:41+00:00Added an answer on June 9, 2026 at 4:59 pm

    Its a problem with certain browsers trying to round subpixel (decimal) widths. The percentages are converted to pixels automatically.

    If you go through and add up the calculated width in pixels of the elements in your jsfiddle they don’t add up to the width of your container element.

    Here is some more info
    http://css-tricks.com/percentage-bugs-in-webkit/

    and

    How do I get around the IE CSS percentage rounding problem?

    and

    Hi,

    I don’t have exact details of what browsers do but I have noted the
    following in the past.

    When dealing width Pixels:

    Firefox will round 125.5px up to 126px and 125.4px will be rounded
    down to 125px.

    Opera will treat 126.9px as 126px (but it will treat 126.999 as 127px
    !!)

    IE ignores all the decimal points and treats 126.9999px as 126px.

    When dealing with percentages.

    Opera doesn’t seem to take any notice at all of the decimal portion of
    percentages. e.g 33.9% will only equate to exactly 33%. Therefore
    for three floats of 33.333% in a 1000px width Opera will show a 10px
    gap at the right edge.

    Mozilla seems to keep a running total of the decimal parts of
    percentages used and will at the most only be 1 pixel out on the full
    width.

    IE rounds each portion up or down individually and therefore for three
    floats will possibly be 3 pixels too big thus causing a float drop.

    To stop the floats dropping in ie you can apply a negative right
    margin to the last float that will soak up the extra space.
    (margin-right:-3px).

    For opera there is no cure but perhaps to make the last element fit
    the space required or to make the elements bigger than needed and
    apply a larger right negative margin.

    This is the reason that most people simply use 33% because then they
    know it will fit all browsers even if there is a slight gap which
    depending on the situation may not be noticable. (e.g. the background
    color of the element behind may hide it.)

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
We're building an app, our first using Rails 3, and we're having to build
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

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.