PDA

View Full Version : Stretching background



niv
20 Feb 2011, 07:41 PM
Hi, I was wondering if it were possible to have the background of a div stretch vertically. How can I go about doing this?

Iced Earth
20 Feb 2011, 07:59 PM
Why hello again! haha

Sure...what you gotta do is add three DIVs inside the column div, say bubble_top, bubble_mid, bubble_bottom (or whatever). Apply bubble_02 to the middle piece...like:


.bubble_mid {
background:url(images/bubble_02.png) repeat-y scroll 0 0 transparent;
width:450px;}

Then you would put all your content (paragraphs, headings) in there (the middle DIV).

But -- you will probably want some padding added, otherwise the text will be right up against the sides. So maybe:


.bubble_mid {
background:url(images/bubble_02.png) repeat-y scroll 0 0 transparent;
width:450px;
padding: 40px 20px;}

That will apply 40px to the top/bottom, and 20px to the left/right. Or you could do: padding: TOPpx RIGHTpx BOTTOMpx LEFTpx;