CSS - using one background image with multiple images on it

前端 未结 7 2033
情书的邮戳
情书的邮戳 2020-12-29 09:55

I\'ve observed that often the websites use only one background image which contains multiple images on it. For example, instead of using separately icons, all of the icons a

相关标签:
7条回答
  • 2020-12-29 10:37

    The technique is called CSS Sprites. Basically you use CSS's background-position property and fixed height or width for your element.

    If your elemnts are fixed width and fixed height at the same time you can freely create a more compact image. See this site for more complex examples.

    0 讨论(0)
提交回复
热议问题