Happy New Year Everyone ! i need some help with divs ..

They have: 45 posts

Joined: Jun 2009

guys i need help with divs i have a container div which containes 2 divs that are are suppose to be next to each other div left and div right but the

#divleft {
float: left;
)
#divright{
float: right
}

but the right div goes to the right but stays under the left div .....

please help

He has: 131 posts

Joined: Jun 2008

I think you have to define a width for each div and from expirence if using a percentage be sure to leave some extra space between them.

example

#divleft {
float:left;
width:30%;
}
#divright {
float right;
width:65%;
}

However I prefer to align them both to the same side to eliminate or control the emptiness in the middle. The css is like

#leftdiv {
float:left;
width:30%;
}
#rightdiv {
float:left;
width:65%;
}

And the HTML like this to get them in the correct spots

<pre>
<div id="leftdiv">
Left div contents
</div>
<div id="rightdiv">
Right div contents
</div>
</pre>

Hope this helps

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.