I'm trying to give a div a background according to a spritesheet, meaning that it'll define the parts from the sprite sheet and use those accordingly in the div. This is my sprite sheet image: http://i.imgur.com/l6BpAOA.png Now I would like to have a "dynamic" div that could get resized and would look similiar to this: ![enter image description here][1] If anybody could help or point me in the right direction that would be appreciated. [1]: https://i.sstatic.net/ZKtvL.png