PDA

View Full Version : Stretchy Div in a Template


keastie
12-07-2009, 04:35 PM
Hi Guys,
I have created a template which is working really well, the only problem is some of my pages have a lot more content than others, meaning that the content is overflowing the Div that its going into. Any ideas on how I can get it so that the Div stretches with the content on each individual page?
George

Corrosive
12-07-2009, 05:33 PM
Just make sure your divs are relative and don't give them a height and they will stretch with your content.

thedon
12-08-2009, 04:31 AM
What do you mean?
Put position: relative ?

I have a simuilar question, I have 3 columns and would like all 3 to be the same size on each page which will have different amounts of content. How do I do match all of them up?

edbr
12-08-2009, 05:01 AM
making them the same legnth is not possible as such if in a containing or wrapper div, the wrapper will expand with the longest div but using faux images can make them appear the same

keastie
12-08-2009, 09:28 AM
Thanks Corrosive, just took the Length amount out and the box just grew and shrank with whatever was in the div

Corrosive
12-08-2009, 09:31 AM
Yep, that's the plan :)

I very rarely use the 'height' CSS property for layout. I like my sites to be as flexible as they can be. The reason I said use relative is so that the divs push down on the divs below. You sometimes get overlap when absolute is used.

Glad you got it sorted anyhoo.