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

clear:both

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?

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.