{"id":2418,"date":"2009-03-24T05:45:01","date_gmt":"2009-03-24T12:45:01","guid":{"rendered":"http:\/\/css-tricks.com\/?p=2418"},"modified":"2009-03-24T06:20:05","modified_gmt":"2009-03-24T13:20:05","slug":"layout-packs","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/layout-packs\/","title":{"rendered":"Layout Packs"},"content":{"rendered":"

I thought I would take a crack at a couple of common multi-column fluid-width layout styles that are notoriously quirky with CSS. <\/p>\n

One way to accomplish a multi-column fluid layout is to set the columns with percentages. For example, floating a left column that is 19% wide and a right column that is 80% wide (keeping it under 100 prevents them from knocking into each other and knocking down). I really dislike doing it this way. It prevents you from doing pixel-based padding on those columns (problematic), leading toward extra div’s. Even worse, the “gutter” between those two columns grows and shrinks, so at the browser windows narrowest, 1% is too narrow, and at it’s widest, it is too wide. <\/p>\n

A far better fluid-width technique (assuming you are comfortable with only one of your columns being the “fluid” one) is to not rely on percentages at all, but rather min and max widths on a single column. In fact, that single column isn’t really a column at all, but the entire width of the layout. The content inside can be pushed away from the edges with padding, making room for absolutely positioned sidebars.<\/p>\n

This technique is littered with juicy advantages:<\/p>\n