I am trying to achieve a layout which adjusts to the resolution of the user's screen, but also lines up with other elements on the page.
I want to have two boxes at the top of the page, next to each other (floated left), with some more boxes below them which line up with the edges of the boxes above.
Code:
+--------+ +--------+
| Box 1 | | BOX 2 |
+--------+ +--------+
+-------------------+
| BOX 3 |
+-------------------+
+-------------------+
| BOX 4 |
+-------------------+
Everything lines up perfectly if I use % margins, until I add borders. If I add a 1px border, everything goes out of line. This is one of the biggest downfalls with CSS, in my opinion. Is there any way to make everything line up while still using borders and fluid widths, short of using Javascript to determine the viewport dimensions?