Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zooming in Firefox Causes Page Layout to Break

I'm having trouble with this page: http://seatgeek.com/atlanta-hawks-tickets/. If you zoom out one level from the "normal" setting in Firefox, the page looks like this: Example broken image. This happens with both versions 3.6 and 4.0 of FF. It does not happen with Webkit.

Clearly the problem lies in the elements within the "list_details" div. The problem can be fixed by decreasing the width of the "col1" or "col2" spans by 1px or by increasing the "vevent" li element by 1px, but these fixes cause the design to render improperly.

If you add up the width of "col1" and "col2", also taking into account their horizontal padding and border, the total width is 647px. But it only displays properly in Firefox (when zoomed out one level) when the "vevent" element, which contains the two, has a width of 648px. Why is that?

like image 900
Jack7890 Avatar asked Apr 03 '11 00:04

Jack7890


People also ask

How do I reset Firefox zoom?

To reduce the size of the displayed content, press Ctrl (Windows, Linux)/command (Mac) and - at the same time. To reset the size back to default, press Ctrl (Windows, Linux)/command (Mac) and 0 at the same time.

How do I fix Zoom in Firefox?

In the General panel, go to the Language and Appearance section. Under Zoom, use the drop-down menu for Default zoom to select a zoom level for all pages. Firefox will still remember individual site zoom levels you set. To set a zoom level for text only, select the Zoom text only checkbox.

What is Firefox Default zoom?

Firefox 73 thus implements a new global default zoom level setting (about:preferences => Language and Appearance). You can set the default zoom level for all sites by scaling the magnification up or down from 100% as needed. You can also specify whether to enlarge only text or all page contents.


2 Answers

as this appears to have been bumped, but the original code is not available, I can say that the difference would have been caused by rounding (or sub pixels), the OP said the problem didn't happen when the div was 648px wide.. an even number can be halved, or split between 2 columns (OP also mentions 2 columns) quite easily no matter the zoom level

However the odd number647px will have been treated differently by Firefox

I cannot say exactly how as I can no longer see the widths of the two columns, but this blog post by John Resig, may explain better

Sub-Pixel Problems in CSS

one possible solution, or at least a helper, is to make sure the available width of the container is always divisible by the number of columns?

like image 78
clairesuzy Avatar answered Oct 31 '22 23:10

clairesuzy


removing the margin-right from the following css fixed the zoom out issue

#left_container .search_details .list_details {
    margin-right: 1px;
}
like image 25
MikeM Avatar answered Oct 31 '22 22:10

MikeM