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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:18:49+00:00 2026-05-22T14:18:49+00:00

Very simply, there are 2 divs inside a div with 610px width 1) div1

  • 0

Very simply, there are 2 divs inside a div with 610px width

1) div1 has width of 60% of parent = 366px, padding-right = 5% = 30.5px
2) div2 has width of 35% of parent = 213.5px

both divs are floated left inside of parent div.

So on most browsers, they all float inside on the same level, because 366 + 30.5 + 213.5 = 610px, and I am suspecting Firefox, Chrome, and IE 8/9 actually truncate 30.5 to 30 and 213.5 to 213, so the 2 divs ended up a little bit narrow in the parent div, but it isn’t a big issue, really, to be 1 or 2 pixels off.

The big issue is with IE 7, that it round up 30.5 to 31, and 213.5 to 214, and now, the total space needed = 611px and therefore div2 cannot float on the same level, and need to be pushed down. (floated below div1)

What is the best way to handle this? I am tempted to just change 5% to 4.9%, and 35% to 34.9%, and actually, I think I probably need to change one of them, because the only issue is when both happen to be ending with .5, so if one is “lessened” a little bit, then the .4 and .5 will have the effect of one getting rounded down, and one rounded up on IE 7. But doesn’t this affect the result on FF/Chrome/IE 8 and 9 as well? What is the best or most elegant solution for this, to work in IE 7 to 9 and all other major browsers?

  • 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-22T14:18:50+00:00Added an answer on May 22, 2026 at 2:18 pm

    If you need pixel precision for your on screen rendering, you need to specify pixel precision in your widths.

    What is the benefit of specifying percentages within a fixed pixel width parent container? Percents are only meaningful within a context of parent containers that also have some form of relative sizing, such as percents.

    You should change div1 to width of 366px and padding-right of 30px, and div2 to a width of 214px.

    If you are limited to only specifying percentages for some reason, then yes, you can specify extra decimal points in your percentages to get the calculations correct. Drop them by .1 or .2% until the largest ones consistently round down to the right pixel sizes.

    As an alternative, you can remove the padding-right from div1 and float div2 to the right instead of to the left.

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

Sidebar

Related Questions

I have a list of a very simply entity, which has a nullable DateTime
I have two divs, both with position:absolute; , one inside the other. The parent
Very simply, is there a one to one connection between a thread(or NSThread) and
There is an inner div of fixed width and variable height contained by an
My question is very simple: Is there any solution to install xCode, or equivalent,
Very simple question, is there any cloud server enviroments avaliable these days for us
I guess there will be a very simple answer to this. But here goes.
Im sure there is a very simple solution for this. I have a bunch
This should be very simple question. There are many programming languages out there, compiled
I just want to design this very simple website. Basically there are multiple pages

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.