View Full Version : Two div tags even

09-19-2007, 11:14 PM
Kind of a simple question, I suppose. But, how do you make two div tags horizontally the same. Like have the sidebar be even with the main content div. Whenever I try to do this, they just end up being stacked vertically.

09-19-2007, 11:21 PM
it would be of great help to see your code but, as a guess, have you tried floating the earlier div to the left so that other one can come up to the right of it (subject to width dimensions). You may have to float one 'left' and the other 'right'.

perhaps like this

<div id="firstDiv">text etc in here</div>
<div id="secondDiv">text etc in here</div>

then your css might be like this:

#firstDiv, #secondDiv {
attributes, common to both, here

float : left;

#secondDiv {
float : right;


09-20-2007, 01:59 AM
Well, when I do that, it makes the height of that div tag 0, and screws everything up. I don't want to statically set the height of it, as I want it to dynamically change with the content.

Here's a link:

09-20-2007, 02:16 AM
okay your going to need to set a width (either % or actuall width [px etc...] of one of the divs (usually the non floated one if its a sidebar sort of deal) height wise the divs will expand to the content in them.

09-21-2007, 12:37 AM
I'll just ask in here.


On that site, how would I get the navigation bar on the left to have the same height as the main text area (The white part)?