Forum Moderators: not2easy

Message Too Old, No Replies

CSS Sprite Background Image Shifts when scrolling

CSS Sprite CSS Sprite Background Image Shifts when scrolling

         

atkt forever

7:19 pm on Aug 20, 2008 (gmt 0)

10+ Year Member



I am using CSS Sprites. CSS Sprites makes use of background images. Now the problem here is when there is a scrollbar and I scroll to the bottom of the page, hiding the images from the sprite. Now when I scroll back up and the images reappear, they are slightly distorted. I have read some where that when we move a scrollbar the background images are repositioned or rendered again when we move the scrollbar such that the background images reappear. Well the fix could be to mark the background property of the CSS Sprite as fixed but then using sprites becomes difficult and the position of images remains fixed and it actually moves with the scroll bar. Any ideas? thanks

csuguy

7:39 pm on Aug 20, 2008 (gmt 0)

10+ Year Member



Code Please.

Fotiman

8:20 pm on Aug 20, 2008 (gmt 0)

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



I've read that this will fix certain IE rendering issues related to scrolling:

html { 
background : url(null) fixed no-repeat;
}

atkt forever

11:44 pm on Aug 28, 2008 (gmt 0)

10+ Year Member



I fixed the bug by setting a fixed height on the div that contained the image. The height is equal to the size of the image. Also Link to some related info: [positioniseverything.net...]