Anriëtte Myburgh
Anriëtte Myburgh

Reputation: 13537

Help needed with DIV-layout for site

I am trying to build a page with the following in it:

Already have the following:

What I am struggling with:

So to summarise:

<div class="page">
    <div class="header">header image</div>
    <div class="container">
        <div class="leftShadow"><img src="images/spacer.gif" alt="" /></div>
        <div class="custom_content">(this is where the content would be)</div>
        <div class="sidebar_right">(some other links)</div>
        <div class="rightShadow"><img src="images/spacer.gif" alt="" /></div>
</div>

So what is supposed to happen is, when either custom_content or sidebar_right div's strength in length below the other, the other one would stretch in height to be the same with as the longer div. Obviously, both side div's (leftShadow and rightShadow) should also stretch to 100% of the container's height.

Can someone please guide me in the right direction? Basically, these div's should behave much like a table would when one td's content stretches beyond the height of the other td's.

Upvotes: 1

Views: 346

Answers (4)

Charlie
Charlie

Reputation: 10307

I'd do this differently because you're not going to get your divs to behave like tables.

I'm not entirely sure what you're wanting this to look like, but I'm guess you want some sort of shadow image down the left and right side of the container div. How about removing the leftShadow and rightShadow divs, put a repeatable background image on the content div of width 809px (and maybe height 1, depending on what your shadow image looks like). Also perhaps set overflow:hidden on the content div - if I remember rightly thats a kind of hack which will make the containing div stretch in this situation.

Upvotes: 0

jrharshath
jrharshath

Reputation: 26583

Perhaps you won't need the leftShadow and rightShadow divs: take a look at faux columns.

This is what you are looking for, I hope. :)

Upvotes: 0

Anthony Lewis
Anthony Lewis

Reputation: 304

Why not use something like "Faux Columns"?

See http://www.alistapart.com/articles/fauxcolumns/

Upvotes: 1

Tyler Rash
Tyler Rash

Reputation: 1173

Don't use divs like tables!

The leftShadow and rightShadow divs are completely unnecessary. Combine your background images into a single image and set it as the background of your container div.

To make sure the background image fills the height of the container, set background-repeat: repeat-y.

Upvotes: 4

Related Questions