tyl3r
tyl3r

Reputation: 33

Use sprite image in ul list?

Im trying to change my ul li list to use it with background image & sprites, but i have this problem with background-repeat, what i'm missing?

http://jsfiddle.net/R7MU4/

Upvotes: 0

Views: 635

Answers (1)

Tom Pietrosanti
Tom Pietrosanti

Reputation: 4294

Since your sprite is tiled vertically, you need to use an element that will have a height equal to that of each of the sprite images.

One option is to use another element, like a span, and apply the background to that. http://jsfiddle.net/mestekweb/R7MU4/2/

You could also apply the style to the link element. http://jsfiddle.net/mestekweb/R7MU4/3/

In both cases, you'll have to adjust the margins and padding of the lists and/or links to compensate.

Upvotes: 1

Related Questions