This is something I've been slightly obsessing over recently.

Say for example you were asked to create a two-column design, I would do this by floating the left column left, giving it a width, and giving the right column a left margin equal to the left column + about 20px.

There's so many different ways this can be accomplished, how would you do it? Is there anything wrong with my technique?

And if you were asked to create a header with say a logo on the left and login info on the right, I would do this by floating the logo left, the log in info right, and having an empty div with a


style attached to it, I prefer this because I hate assigning anything a height in CSS, again how would you do this? Is my way right? Is there anything wrong with it? Would you just give in and assign it a height in CSS?

Are there standardised ways for going about these things too?

6 Years
Discussion Span
Last Post by Dandello

There's no standard way - For me, on a two column layout, I'd float both divs (left and right), both at 49% wide. I generally have 'clear:both' as a class named clear, so I can clear the divs in whatever I have coming after them. (hr, br, whatever.) For height - I use a lot of divs with borders, so I'll add a min-height to the divs to keep them aligned for height as much as I can without resorting to a container div with a background to set a vertical line.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.