So, here is the outline of my HTML structure:
<li class="block1">
<a title="Block 1 Title" href="get/wzTZKKrI1kQ">
<img height="150" width="200" alt="Block 1 Title" src="http://lorempixel.com/output/city-h-c-170-230-2.jpg">
<span>Block 1 Title</span>
</a>
</li>
And this is the CSS code I'm using:
#home #results li{
float: left;
list-style: none;
margin: 0 10px 10px 0;
display: inline-block;
height: 200px;
width: 200px;
padding: 10px;
overflow:hidden;
text-align: left;
}
#home #results li.block1{
background: #E1D4C0 url("../imgs/bg/lp-bg.png") no-repeat top center;
z-index: 1
}
However, I am facing an issue where the background image of #home #results li.block1 seems to be showing behind the html img/#home #results li img. Why is this happening even though I have tried adjusting the z-index?
Edit: Here is a screenshot for reference:
I was able to resolve the issue. Feel free to check out my solution in the answer below.