Happy New Year Everyone ! i need some help with divs ..
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
cmoyer posted this at 03:53 — 3rd January 2010.
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
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.