vikmalhotra
vikmalhotra

Reputation: 10071

background image vertical repeat for a div

I want to repeat a background-image for a div vertically till the bottom of the page.

#repeat {
   background: url(repeat-image.png) repeat-y;
   height: 100%; /* this does not work, but height: 1024px; does */
}

This does not work. I need to do so according to the page design that I have got. Can this be done?

With regards Vikram

Upvotes: 2

Views: 5089

Answers (2)

kainosnous
kainosnous

Reputation: 558

For web pages, height is a funny thing. Since web pages expand vertically, the total height of your page can actually be 0. You may consider using min-height for each element that requires at least a certain height. You can use height: 100% to fill the full height of the parent.

Upvotes: 2

oezi
oezi

Reputation: 51797

try to set height:100% for your <body> and <html>, too. if there is nothing except this div on your page, 100% height will be 0px without these settings.

Upvotes: 3

Related Questions