Is it possible to set a background image on an img tag?
This is my current HTML markup:
<div id="content">
<img src="my-image.jpg" alt="image" class="img-shadow">
</div>
Here is my CSS code:
#content img {
float:right;
margin:0 0 15px 15px;
border:4px solid #ffffff;
}
.img-shadow {
background-image:url('img-shadow.png');
background-repeat:no-repeat;
background-position:0 232px;
}
Although Chrome's "Inspect Element" shows the correct path to the background image, it does not display in the browser. I am aiming for the desired effect shown below. The foreground image size is 258x258 (including the border), while the background-image size is 258x40.