The div that I want to apply a background on is larger than my sprite, and the part of the sprite that I want to use as the background is 100px from the top of the sprite.
How can I set the background of the div to be the part of the sprite I want, and have it be positioned to the right side of the div.
What I have: http://jsbin.com/yibesu/1/edit?html,css,output
I want the "what-i-want" background to be pushed to the right side of the div, and the rest of it be the red color.
My CSS:
div {
background: url('http://i.imgur.com/VBe5ey2.png') red;
background-position: 0 -100px;
background-repeat: no-repeat;
width: 400px;
height: 200px;
}
It's like I want the background position to be "0 -100px" and pushed to the right of the div. The sprite's width is smaller than the div. Is this possible? Or do I need to just rip the part out of the sprite and have it be it's own image? Thanks!