This simple HTML5 layout has a navigation bar on the left with body text placed next to it (using percentages rather than pixels for a flexible, responsive design - calculations in CSS comments).
http://www.wturrell.co.uk/stackoverflow/20110615-01.html
The widths of the elements inside the "page" div are up to 100%. I want to add an addition to certain elements, in this case nav. If I remove all the add-ons, they will float correctly, but more than 1 or 2 pixels of indentation (regardless of the units in which it is indicated), and it breaks. I donβt understand why this violates the layout, since its filling so uncertainly should not change the total size of the block?
What did I miss?
Update - solution:
http://www.wturrell.co.uk/stackoverflow/20110615-02.html
(Element screen width = width plus border plus . Navigation should be nominal 200 pixels with a total of 20px padding on the right, so for fluid design width = 180/900 * 100 or 20%, indentation = 20/900 * 100 or 2.222%, and the main text remains 700/900 * 100 or 77.777%.)
source
share