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

前端 未结 4 1174
爱一瞬间的悲伤
爱一瞬间的悲伤 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 13:59

    It shouldn't need to be padded, but when zoomed, especially in IE8 (betas more than the RC), there is image bleeding if there is no padding.

    Best example is to go to Google.com -> Search, and zoom... you'll start to see "underlines" at the bottom right of the image as the zooming rounds up/down.

    In theory, a 1px padding on all sides of a sprite should be fine.

    Here's the sprite from Google (images)...

    alt text

    But when zoomed, the +,-,x icons bleed into the main Google logo.

    alt text

提交回复
热议问题