Jump to content

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
Link to comment
https://forums.phpfreaks.com/topic/18723-order-of-containers/
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.