Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS sprite image + background-repeat a part of it

Can I repeat a part of an image [which it's in a CSS sprite image] in the background ?!

like for example :

background-position : -13px top ; background-repeat : repeat-y ;

because I got the whole sprite image repeated ...

like image 958
Waseem Avatar asked Apr 06 '11 13:04

Waseem


People also ask

How do you repeat a background image in CSS?

The background-repeat property sets if/how a background image will be repeated. By default, a background-image is repeated both vertically and horizontally. Tip: The background image is placed according to the background-position property.

How do I make my background image not repeat CSS?

If you want the background image not to repeat at all, use background-repeat: no-repeat; .

What are the 4 options on background-repeat?

1, the background-repeat property had four options: no-repeat , repeat , repeat-x and repeat-y . While these are undoubtedly useful, they don't permit finer control over the repeating process and tiles will be clipped if they don't fit the container an exact number of times.


1 Answers

If you place your images side by side in a really wide sprite you'll be able to use repeat-y. If you need to use repeat-x you can place the images in the sprite above each other.

like image 144
Gareth Avatar answered Oct 07 '22 18:10

Gareth