Is it possible to use repeating background images

2019-04-28 00:20发布

Possible Duplicate:
CSS Sprites and repeating backgrounds

Are there any tricks that makes it possible to use sprite images as repeatable backgrounds?

2条回答
在下西门庆
2楼-- · 2019-04-28 00:32

Nope, not really. Not even CSS3 offers an approach to do this properly (there is the proprietary image-rect property as shown in the duplicate question but it's not supported by all browsers).

查看更多
相关推荐>>
3楼-- · 2019-04-28 00:34

Yes you can but there are some limitations and it depends how the images are repeated. Here is how you would go about this depending on repeat direction:

Repeat: Don't think this is possible.

repeat-X: You would stack these vertically in your sprite sheet. You can only have one image per "row". All images must have the same width.

repeat-y: You would line the iages horizontally and have only one image per "column". All images must have the same height.

You are also limited to having separate sprite sheets for each repeat/no-repeat method.

查看更多
登录 后发表回答