CSS sprite image + background-repeat a part of it
Asked Answered
Z

1

11

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 ...

Zymogenic answered 6/4, 2011 at 13:29 Comment(0)
L
10

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.

Lingcod answered 6/4, 2011 at 13:51 Comment(3)
what do you mean by "wide" in pixels ?!Zymogenic
@Zymogenic assuming you have 20 images in the sprite each with a 100px width, then the sprite would be 200px wide.Lingcod
@Zymogenic - here is a link to help support @Gareth's explanation -> CSS background-repeatSanta

© 2022 - 2024 — McMap. All rights reserved.