Jump to content

layout issues - 3 column


Technaut

Recommended Posts

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

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.