简体   繁体   English

“ CSS Sprites”和背景重复

[英]“CSS Sprites” and background-repeat

is it possible to make CSS Sprites technique work well with background repeat? 是否有可能使CSS Sprites技术与背景重复一起很好地工作? Thanks!c 谢谢!Ç

Generally not. 通常不会。 It could be done if the repeating images: 如果重复图像可以完成:

  • All repeat in only one direction 全部只在一个方向上重复
  • All repeat in the same direction 所有重复方向相同
  • All the same width or height (depending on direction) 宽度或高度都相同(取决于方向)
  • Are as wide or tall (ditto) as the widest or tallest image in the collection 与集合中最宽或最高的图像一样宽或高(同上)

It's possible with repeat-x & repeat-y, however you'll have to take this into consideration when designing your sprite. 可以使用repeat-x和repeat-y,但是在设计精灵时必须考虑到这一点。

For example you may have one sprite for general buttons, components, etc and another sprite for handling horizontal backgrounds. 例如,您可能有一个精灵用于常规按钮,组件等,而另一个精灵则用于处理水平背景。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM