Forum Moderators: not2easy

Message Too Old, No Replies

CSS Sprite?

How to place two sprites in the same div

         

lostdog

7:43 pm on Oct 8, 2010 (gmt 0)

10+ Year Member



Hi,

I am working on speeding up one of my sites by implementing css sprites. I want to use two sprites horizontally. I have not been able to this in a <div>. Images are not showing using <span>. Any help will be greatly appreciated.

enigma1

12:50 pm on Oct 9, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What is the css/html you're having trouble with? Have you applied the offsets for the background position and doesn't work?

londrum

2:55 pm on Oct 9, 2010 (gmt 0)

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



i would do it with one <div> inside another.

apply the first background to the outer <div>, and then the second background to the inner <div>.

then all you've got to do is position the second div so it doesn't overlap the first background, probably by giving it a left-margin.