Well, I am wondering if we can repeat a background with an arbitary offset in CSS ? From that i mean can we "Shift" a tile x and y pixel everytime its rendering it ? The uses cases could be mosiacs, patterns and a lot of stuff, Even isometric tiling can be achieved using so.
For example if i have a tile of 10px x 10px
Each time the tile is repeated i want to shift it 10px from top so what i will achieve is
[//]
[//]
[//]
[//]
So is there any existant solution or is Canvas just the way to go ( Do it in canvas and then use it as a background )
The background-repeat property in CSS is used to repeat the background image both horizontally and vertically. It also decides whether the background-image will be repeated or not. Background-repeat: This property is used to repeat the background image both horizontally and vertically.
The background-repeat CSS property sets how background images are repeated. A background image can be repeated along the horizontal and vertical axes, or not repeated at all.
As of CSS3, this can't be done using only CSS styling. Repeated patterns are periodic either in the x (horizontal) direction, y (vertical) direction, both directions simultaneously, or neither (single image).
Reference: http://www.w3.org/TR/css3-background/#backgrounds
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With