Jump to content

Archived

This topic is now archived and is closed to further replies.

Ricklord

order of containers

Recommended Posts

Hey Guys,

Im creating a demo store for my website and was just wondering if some one could help me with a small problem.

If you look at the site here [url=http://www.creativecogs.co.uk/ecommerce_demo]www.creativecogs.co.uk/ecommerce_demo[/url]

The side bar and the 2 content areas have been set up in my CSS but i have had to put tables in to be able to get the background to expand as content is added.

Is there away to get the backgorund image to expand without using a table?

At the moment i have got the 2 containers as below and then just inserted tables into the containers with 3 rows and split the image for top, body and bottom so that the body cell will expand and the background will repeat.

css for this part
[code]
#sidebar {
float:left;
width: 200px;
background-color:#FFFFFF;
}

#content {
float:left;
width: 580px;
background-color:#FFFFFF;

}

#footer {
clear:both;
width: 780px;
height: 30px;
padding: 10px 0 0 0;
text-align:center;
background-image:url(images/footer.gif);
background-repeat:no-repeat;
}[/code]

HTML with how i have added the tables and looks messy which is why i want to get it all in CSS if possible

[code]
<div id="sidebar">
  <table width="200" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td width="200" height="20" background="images/sidebar_top.gif">&nbsp;</td>
    </tr>
    <tr>
      <td width="200" height="20" background="images/sidebar_body.gif"><p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p></td>
    </tr>
    <tr>
      <td width="200" height="20" background="images/sidebar_bottom.gif">&nbsp;</td>
    </tr>
  </table>
</div>

<div id="content"><table width="580" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="580" height="20" background="images/content_top.gif">&nbsp;</td>
  </tr>
  <tr>
    <td width="580" height="20" background="images/content_body.gif"><p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p></td>
  </tr>
  <tr>
    <td width="580" height="20" background="images/content_bottom.gif">&nbsp;</td>
  </tr>
  <tr>
    <td width="580" height="20" background="images/special_top.gif">&nbsp;</td>
  </tr>
  <tr>
    <td width="580" height="20" background="images/special_body.gif"><p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p></td>
  </tr>
  <tr>
    <td width="580" height="20" background="images/special_bottom.gif">&nbsp;</td>
  </tr>
</table>
</div>[/code]

I have tried to do this a couple of ways but i always loose the order of my containers and it ends up being all messy.

If anyone knows what i need to do please can you post example code or point me in the direction of the code i need to change/include.

Thanks in advance

Rick

Share this post


Link to post
Share on other sites
http://www.alistapart.com/articles/fauxcolumns/

That's how 'everyone' solves the problem simply.

Share this post


Link to post
Share on other sites
Cheers Andy,

Managed to get it to work now, not sure if its the corrent way but looks alot tidier now its in CSS with the rest of the page.

That site was helpful but didnt give me the exact answer.

Cheers again

Rick

Share this post


Link to post
Share on other sites

×

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.