A lot of designers are currently struggling to accomplish page layout that was simple to achieve using tables but is frustratingly difficult (if not impossible) with CSS. The following example shows a simple method to display a mutli-column content layout without having to worry about complex floats, margins, and padding.
It all begins with a simple unordered list with a line item and div for each column. We assign an id selector to each item that may have individual CSS styles applied to it (eg id="column1"). Then add a style sheet class for all items that share formatting (eg: class="r_column").
The real magic occurs in the CSS where we make the list appear horizontally rather than vertically. Because of differences in browsers we have to set the margin and padding explicitly. The rest is explained in the code below.
Put it all together and we get:
First Column
Second Column
Third Column
Now isn't that about as simple as you can get?
Add your comment