上記の私のコメントを拡張し、JavaScriptを使用して画像を背景画像に動的に変更する方法を正確に示すことにしました。
JavaScript:
$('li').each(function(index) {
// Find thumbnail image
var thumb = $(this).find('img');
// Get the src
var thumbsrc = thumb.attr('src');
// Insert a span (absolutely positioned using below css)
thumb.after('<span class="thumbnail" />');
// Apply our thumbnail as a background image to the span
$(this).find('span.thumbnail').css("background-image", 'url(' + thumbsrc + ')');
// remove thumbnail image
$(this).find('img').remove();
});
CSS:
.thumbnail {
width:18px;
height: 16px;
display:block;
position: absolute;
left:10px;
border-radius: 5px;
}
実例:
http://jsfiddle.net/x54A6/1/