But just to double check myself, I did a few searches on how other people recommend doing 3+ column layouts. Needless to say, I’m here because I cannot find my method replicated.
In all the discussion, there’s a lot of talk about the importance of floating layouts, as well as, splitting the above four columns into additional DIVs. I am very confused. Basic questions:
Is this code satisfactory? And if not, what’s the preferred way?
Floating is the best for columns because it allows widths
ALl browsers will put the space between each column with display:inline because since it is an inline element, it renders the white space in the HTML, closing that up in the actual source code would eliminate it (or connect it in the HTML via comments
No. I just did that as a demonstration. You can set the columns to any width you want as long as they do not exceed the width of the container “wrap”, which you can also set to any width you want. If your floated columns exceed the width of their parent container, the one furthest on the right will drop below the other floated columns.
In addition, you can have multiple columns within each column so you could have a newspaper-like layout if you wanted. Just remember to use “clear: both;” after every set of floated columns.
You could also use display:inline on divs to create a column layout. However, Firefox puts an inexplicable space between each column and, worst of all, you cannot specify a minimum width because inline elements have no width.
No, do not use absolute positioning for columns. Float your columns. You generally do not want to screw with the natural layout flow of your pages by using positioning unless absolutely necessary.