Forum Moderators: not2easy

Message Too Old, No Replies

CSS Sprite question

         

getxb

11:44 am on Aug 21, 2008 (gmt 0)

10+ Year Member



Can we repeat a vertical dashed line (image) that is included inside a master sprite image with the help of CSS Sprite?

Thanks,
Ramnath

Fotiman

1:31 pm on Aug 21, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Suppose your sprite image looks like this:

+---------+ 
¦::.\\.//.¦
¦...\\.//.¦
+---------+

In this image I have 3 images that I care about. They are:
1)

:: 
..

2)
\\ 
\\

3)
// 
//

Because there is only 1 horizontal row of images within the sprite, I can safely repeat the background vertically. For example, I could this:

#myItem { 
width: 2px;
height: 200px;
background: url(mysprite.png) 0 0 repeat-y;
}

You can only repeat the image vertically if your sprite image contains only 1 horizontal row of images.
Make sense?

[edited by: Fotiman at 1:32 pm (utc) on Aug. 21, 2008]

sgietz

4:16 pm on Aug 21, 2008 (gmt 0)

10+ Year Member



Perhaps I'm getting rusty and don't keep up with the news as I should, but I never heard of CSS Sprite until now.

Love it! :)