Technaut Posted July 12, 2009 Share Posted July 12, 2009 Hi folks, I am trying to create a site which has 3 columns that are side by side each other. ie left column with menus, middle part with content and right menu with banners/menus. Here is the html:- <div id=container> <div id="leftnav"> </div> <div id="rightnav"> </div> <div id="content"> </div> here is the css:- #container { margin: none; width: 100%; border: none; } #leftnav { float: left; width:20%; padding: 5px; margin:0; } #rightnav { width: 20%; float:right; padding: 5px; margin:0; } #content { margin: 0 180px 0 180px; padding: 1em; border-left: none; border-right: none; font-family: "Times New Roman",sans-serif ,arial, helvetica; font-size: 1.0em; line-height: 1.6em; } The problem is that if I put anything in the leftnav html section this displays on the left hand side above the content. The content seems to start after the leftnav instead of beside it if you know what I mean Quote Link to comment https://forums.phpfreaks.com/topic/165686-layout-issues-3-column/ Share on other sites More sharing options...
wildteen88 Posted July 12, 2009 Share Posted July 12, 2009 You need to float the #content div to the left too.Otherwise it will display below your left and right columns. Quote Link to comment https://forums.phpfreaks.com/topic/165686-layout-issues-3-column/#findComment-874018 Share on other sites More sharing options...
haku Posted July 12, 2009 Share Posted July 12, 2009 You're also missing a closing div tag. Quote Link to comment https://forums.phpfreaks.com/topic/165686-layout-issues-3-column/#findComment-874276 Share on other sites More sharing options...
jcombs_31 Posted July 13, 2009 Share Posted July 13, 2009 You have the width of your left/right columns set to 20%, but then you are declaring the margins on your center column to 180px. You can get away with your technique if you fix the columns to a fixed width 180px-. Don't forget about the box model either because you are also applying padding. Quote Link to comment https://forums.phpfreaks.com/topic/165686-layout-issues-3-column/#findComment-874292 Share on other sites More sharing options...
Technaut Posted July 14, 2009 Author Share Posted July 14, 2009 higuys, Thanks for the tips so far. I input the missing closing /div changed the width of the left and right columns to 180px The problem is now I had some tables below containing images etc. These images were always meant to be at the bottom of the page, when I change the float the layout of all of these images is now out of place. Is there any obvious reason why that would happen or shoudl i post the code for the images etc too? Quote Link to comment https://forums.phpfreaks.com/topic/165686-layout-issues-3-column/#findComment-875171 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.