You can use our Gumlet.js library which supports setting images as background for any HTML element.
All you need is to set the data-bg attribute for an element, and the correctly-sized image will be set as a background-image CSS property.
For example: