<data:blog.title/><data:blog.pagename/> - <data:blog.title/>

Back to the CSS article by Matthew James Taylor

The Perfect 3 Column Liquid Layout (Percentage widths)

No CSS hacks. SEO friendly. No Images. No JavaScript. Cross-browser & iPhone compatible.

When we launched this blog on the eve of the federal election in 2007.

Percentage dimensions of the holy grail layout

Three column layout dimensions

All the dimensions are in percentage widths so the layout adjusts to any screen resolution. Vertical dimensions are not set so they stretch to the height of the content.

Maximum column content widths

To prevent wide content (like long URLs) from destroying the layout (long content can make the page scroll horizontally) the column content divs are set to overflow:hidden. This chops off any content that is wider than the div. Because of this, it's important to know the maximum widths allowable at common screen resolutions. For example, if you choose 800 x 600 pixels as your minimum compatible resolution what is the widest image that can be safely added to each column before it gets chopped off? Here are the figures:

800 x 600
Left & right columns: 162 pixels
Center page: 357 pixels
1024 x 768
Left & right columns: 210 pixels
Center page: 459 pixels

The nested div structure

I've colour coded each div so it's easy to see:

Three column layout nested div structure

The header, colmask and footer divs are 100% wide and stacked vertically one after the other. Colmid is inside colmask and colleft is inside colmid. The three column content divs (col1, col2 & col3) are inside colleft. Notice that the main content column (col1) comes before the other columns.

32113231
Home
Home
Estoy en la pagina individual por POST. When condition is true this will be done @@@@@@@@@@@@@@@@@@@@@@@@@@@@ Anterior | | Siguiente data:blog.homepageUrl homeMsg
backlinksLabel