I’m trying to place an image inside a fancy border such that the border overlays the image. I’ve got it ALMOST working, and I’m hopeful someone can give me the last little bit that I need. In the sample below, if I remove the background from the main div container, the image framing works great. With the background, the image is invisible, presumably hidden behind the white container background. Here’s a dabblat for testing: http://dabblet.com/gist/4356232
<style>
div {
background: #fff;
}
a {
width: 287px;
height: 142px;
display: block;
position: relative;
background: url(http://divisioncamera.erentalpro.com/web/list.png) no-repeat;
}
img {
position: absolute;
max-height: 287px;
max-width: 142px;
top: 0;
bottom: 0;
right: 0;
left: 0;
margin: auto;
z-index: -1;
}
</style>
<div>
<a>
<img src="http://placekitten.com/300/300"/>
</a>
</div>
Add to
div