Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: width of 100% not always 100% in Opera

  1. #1
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    2,385
    Thanks
    100
    Thanked 113 Times in 111 Posts

    Default width of 100% not always 100% in Opera

    I have this fun little problem for those who want to play around with it. It is not very important, but I can't figure this out either.

    I have a test page with a footer, a header, and 3 columns in between. I tried to keep the page fairly simple and I might try to prune it down further.

    The Header and the footer have a width of 100% and they are operating as I would expect. The 3 columns have an aggregate width of 100%, but it is not as wide as the header or the footer. To illustrate this I have a background set in blue behind the 3 columns. The blue background should not be visible to the right of column 3, but in Opera it is.

    Is this an Opera bug or am I just scripting this wrong?

    If nothing else, I find this a little odd and interesting.
    Last edited by james438; 10-30-2011 at 04:01 AM.
    To choose the lesser of two evils is still to choose evil. My personal site

  2. #2
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    happens in Chrome, too.

    likely just a rounding issue. Your container is 909px; 32% of that is 290.88px (which Chrome rounds down to 290px); 34% is 309.06px (which is rounded down to 309).

    (On top of that, 32% + 32% + 34% is only 98%.)

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Actually the container varies in width, right? It's set as a % as well or in some other way adapts to the window width. But traq is probably right in a general sense because if you slowly resize the window horizontally, there are points where it fits exactly with no blue over there on the right.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    2,385
    Thanks
    100
    Thanked 113 Times in 111 Posts

    Default

    Interesting, there are points when resizing the window where there is no blue peaking to the right of the right column when I resize the window. Those points are very hard to find. It should not be.

    Traq, the container is 100% not 909px. The width of the first two columns is 32% with a right margin of 1% for a total of 33%+33%+34%. The last column does not have a margin. Any px padding or margin listed is very small and should have no affect on the column widths.

    I am thinking of reporting this as an Opera bug, but I want to find out for sure and also where it is coming from.
    To choose the lesser of two evils is still to choose evil. My personal site

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Well, Chrome does do it too. Which probably means Safari as well. A simple though somewhat limiting solution would be to make that blue color the same as the background color of the columns.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    2,385
    Thanks
    100
    Thanked 113 Times in 111 Posts

    Default

    In that case maybe it is supposed to operate that way. I'll try to post in the Opera forums and see what they have to say about this. I'll try to post back here if I find anything out.

    unfortunately, in my experience, they are not always the best about replying to posts or at least not as good as here. Most likely that is just my experience.

    The blue background is used to illustrate the bug. For now I have added it to my slowly growing list of Opera bugs.
    Last edited by james438; 10-28-2011 at 08:24 PM. Reason: added last paragraph.
    To choose the lesser of two evils is still to choose evil. My personal site

  7. #7
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    sorry for the assumption about the width (that's what the width was, on my screen, when I checked).

    I'd still look at this as a "percentages problem," however, not a browser bug. Different browsers are known to handle rounding percentages in different ways - up, down, every-other, getting most as close as possible and adding (or subtracting) the excess from the last. I read an article about it once, but I don't recall where.

  8. #8
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    2,385
    Thanks
    100
    Thanked 113 Times in 111 Posts

    Default

    That makes sense traq. How did you come up with 909px considering the very fluid design of the page?

    I am going to try something different to take care of this problem, but it is different enough that I will start a new thread.
    To choose the lesser of two evils is still to choose evil. My personal site

  9. #9
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    Quote Originally Posted by james438 View Post
    That makes sense traq. How did you come up with 909px considering the very fluid design of the page?
    that's just how wide it happened to be on my screen, and I didn't look at the css for that part - I was only paying attention to the "column" boxes, and I didn't happen to change the window size. It was an oversight.

  10. #10
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    2,385
    Thanks
    100
    Thanked 113 Times in 111 Posts

    Default

    I understand, but typically a figure of 909px is not something the average person can look at say "yep, that's 909px". I am wondering if you have some sort of program that displayed that figure. It might be an interesting tool to play around with.
    To choose the lesser of two evils is still to choose evil. My personal site

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •