CSS: Two column Div layout misaligns when Zoom changes

To allow for rounding errors, take of a percent. 15% for left and 84% should work.

However, the problem is that you are adding in margins too, that obviously won’t work well.

Consider to first get two divs to use 15% and 84% (or 85% if it works), and then use those two divs as wrappers in which you put a div which you give the right margins. That way, your margins aren’t interfering with the width calculations.

In other words, margins aren’t part of the div’s width.

When in doubt, use a Page/Web Inspector extensively to get an idea of the boxing models…

Leave a Comment