Do I still need to pad images in a CSS Sprite?

前端 未结 4 1181
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-24 13:23

In CSS Sprites you will often find padding between each image. I believe the idea is so that if the page is resized then one image won\'t bleed into another.

I thin

4条回答
  •  忘掉有多难
    2020-12-24 14:05

    Basically the answer is yes. Two years to the day after I asked this question will see the release of IE9. IE9 has this problem just as much - if not more than any other browser...

    It's pretty infuriating because it's such a simple thing to fix.

    With iPads increasing in marketshare - its's pretty essential to at least have a half decent experience with zooming un-uniform amounts.

    I am going to have to put a single pixel border around every image to match the background color of the adjacent element (potentially different on each side). Fortunately I auto-generate all my csssprites based on an .xml file - so I can do this programatically without too much hastle. It's still a huge pain though...

提交回复
热议问题