Drummerpete Posted April 25, 2011 Author Share Posted April 25, 2011 I usually never have a problem with web design, but this is making me angry. XDHere's a snippet of the code:```div#container{ width: 898px; background: #FFFFFF url("images/contentbg.gif") repeat-x; border-top: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; margin: 50px auto 0 auto; padding: 10px 10px;}div#menu{ width: 178px; margin: 0 20px 0 0;}div#content{ width: 500px; padding: 0 10px;}```Now, here's the problem.I want the menu & content side by side within the container.As the code is, menu & content **are** in container.When I addfloat: left;to menu, content moves over to the left BEHIND Menu.Then, when I add float: left; to content, the both go side by side OUTSIDE container.I really hope someone understands what I just said.I also hope someone understands why the hell that's happening, because I don't. Link to comment Share on other sites More sharing options...
Bobosk Posted April 25, 2011 Share Posted April 25, 2011 Did you try adding``` clear: left;```in the #content styling? Link to comment Share on other sites More sharing options...
Drummerpete Posted April 25, 2011 Author Share Posted April 25, 2011 @Bobosk:> Did you try adding```> clear: left;> ```in the #content styling?Yeah, it still buggered up.I've fixed it now - I addedfloat: left;to the menu and a 200px margin-left on the content. Link to comment Share on other sites More sharing options...
Lenton Posted April 25, 2011 Share Posted April 25, 2011 Put float:left; on both menu and content. Link to comment Share on other sites More sharing options...
Drummerpete Posted April 25, 2011 Author Share Posted April 25, 2011 @Lenton:> Put float:left; on both menu and content.I did.They both went outside the container. Link to comment Share on other sites More sharing options...
Chief Posted April 25, 2011 Share Posted April 25, 2011 you could put a float:left on the one on the left, and a float:right on the one on the right, then make sure the containing div is large enough for both. Link to comment Share on other sites More sharing options...
Drummerpete Posted April 25, 2011 Author Share Posted April 25, 2011 @Chief:> you could put a float:left on the one on the left, and a float:right on the one on the right, then make sure the containing div is large enough for both.Like I said, I've already fixed it. XD Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now