Is it possible to use only a piece of the image in a full background?
I have an image:
I want to use it on the background of a div
with width: 100%
and set repeat-x
. But I want to use only the black part, I don't 开发者_如何学编程want to use other images, I want to fix the image on a small piece.
Is it possible?
What you're talking about is somewhat like CSS sprites, I guess.
An article I used myself to learn about them is: CSS Sprites: What they are, why they're cool, and how to use them
--[Edit]--
An example of repeating backgrounds (this one's in the y-direction): Vertical repeating background with CSS sprites
Nope, this is definitely not possible.
There is the clip
property but that works only on elements, not backgrounds.
You will have to use an image that is clipped to your needs.
精彩评论