tags:

views:

423

answers:

2

Basically I'm laying out a website and I'm using DIV's to have a header, left-column, right-column and footer. I want to have the content section of the website expandable to the html/text inserted into it so i have been using height: auto.

I'm using background images for the top of the header, bottom of the footer and a 1px high filler for the body of the website.

My problem is everything I have tried essentially eliminates the middle background image if I try to have the right-col to the right of the left-col and not under it.

I'm sure this is probably something pretty easy but I have been on it since last night and I'm about up done trying to figure it out.

it's valid XHTML and CSS (except for jQuery UI stuff that is CSS3, though that shouldn't matter structurally).

Any ideas or could someone point me to a tutorial on how to get a two column layout using background images?

<body>
   <div id="top">
         THE TOP IMAGE GOES HERE IN CSS
   </div>
   <div id="wrapper">
     <div id="header">

     </div>

     <div id="navigation">
       </div>

     <div id="content">
      <div id="left-col">

      </div>

      <div id="right-col">

      </div>

     </div>
   </div>

   <div id="bottom">
      THE BOTTOM IMAGE GOES HERE IN CSS
   </div>

   <div id="footer">

   </div>
</body>


#wrapper { 
 margin: 0 auto;
 width: 838px;
 background-image:url('../images/wrapper_bg.gif');
 background-repeat:repeat-y;

}
#header {
 width: 818px;
 color: #333;
 padding: 10px;
 height: 100px;
}

#navigation {
 width: 838px;
}

#content { 
 width: 838px;
 color: #333;
 margin: 0px 0px 0px 0px;

 /*min-height: 800px;*/
 height: auto;
}
#footer { 
 width: 838px;
 color: #333;
 text-align: center;

}

#top{
 margin: 0 auto;
 width: 838px;
 height:14px;
 background-image:url('../images/wrapper_top.gif');
}

#bottom{
 clear: both;
 margin: 0 auto;
 width: 838px;
 height:14px;
 background-image:url('../images/wrapper_bottom.gif');
}

#left-col{
 margin-left: 20px;
 width: 590px;
 float:left;
 height: auto;
}

#right-col{
 width: 170px;
 display: inline;

 height: auto;
 margin-right: 25px;
 color: #777777;
 font-size: 15px;
 padding: 5px;
 font-weight: bold;
}

http://www.wholehealthconnect.org/home.php is the website.

Can anyone help me get the middle div to expand to content as well as have the right col next to the left col and still have the background image behind them?

A: 

I am not sure I understood your problem correctly, so do not hesitate to point me in the right direction.

Basically you want the links: FAQ, Professional ... Facebook to show up on the right ?

Why not use a classic:

#right-col {
  float: left;
  margin-left: 610px; /* or perhaps higher */
}

Am I right on track or did I not understood the problem you were stating ?

Matthieu M.
I've tried that. It takes away the background image and still has it below the left col. The only way I've gotten the right col to appear on the right side and still have the background image so far is to make the boxes have static heights which is not what I want.
mmundiff
So I added your CSS and you can see what happened here http://www.wholehealthconnect.org/home.php
mmundiff
ANy time I try to float the right col to the left I lose the background image. I tried lessening the widths on the left and right cols and that didn't work.I'm at a loss here and Have been working on it for hours, even rebuilding the thing from scratch.
mmundiff
A: 

Add overflow:hidden to #content. Should do it.

Adrian Trimble