Daniel
Daniel

Reputation: 127

Background repeat, choose how many repeats CSS

Can I choose, through CSS, how many times the background image is repeated?

Upvotes: 1

Views: 4661

Answers (5)

Karan Shah
Karan Shah

Reputation: 752

You can set an absolute width for a box, but you can't choose the number of times the background image is repeated.

Upvotes: 4

Vlad
Vlad

Reputation: 10780

No, you can't. It will repeat (x, y or both) for the entire element width/height. You can set the element's size to a multiple of your background image width/height.

Upvotes: 0

Balanivash
Balanivash

Reputation: 6867

You can't limit the number of repeats. Either you display the image once, or repeat it to either the length or height of the browser.

Upvotes: 0

Th 00 mÄ s
Th 00 mÄ s

Reputation: 3826

With regular CSS its only possible to select if and in which direction (horizontal or/and vertical) the background repeats.

Upvotes: 1

knittl
knittl

Reputation: 265956

no, you can not specify how many times a background is repeated. the only options you have are: no-repeat, repeat-y, repeat-x and repeat

Upvotes: 5

Related Questions