Is it possible to use repeating background images in sprites?

Possible duplicate:
CSS sprites and repeating backgrounds

Are there any tricks to use sprite images as repeatable backgrounds?

+6
source share
2 answers

Yes, you can, but there are some limitations, and it depends on how the images are repeated. Here's how you do it depending on the direction of the replay:

Repeat: do not think that it is possible.

repeat-X: you will stack them vertically in a sprite sheet. You can only have one image per line. All images should have the same width.

repeat-y: you should align the iages horizontally and have only one image per column. All images must be the same height.

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

+5
source

No, not at all. Even CSS3 does not offer an approach to do this correctly (there is a proprietary image-rect property, as shown in the duplicate question, but it is not supported by all browsers).

0
source

Source: https://habr.com/ru/post/901231/


All Articles