Neil_M
Neil_M

Reputation: 482

Want to repeat a div to fill its parent

I have a div that contains an image and some text.

I want to repeat this div so that it fills the whole of the parent.

ideally it would work the same way tiling an image for the backgorund would work but it is a div instead of a image getting tiled.

Upvotes: 0

Views: 617

Answers (1)

Adan Sandoval
Adan Sandoval

Reputation: 466

I don't think there's a way to do it just in plain html/css. You must use Javascript or another technology to clone the div.

Maybe take a look at jQuery's .Clone() and make a while loop to check until Parent overflows

Depending on your specific needs you could make an image out of the div and then just background-repeat it.

Upvotes: 3

Related Questions