I'm having an issue with positioning an image and a text box using z-index. The image is scaling over the text box when I want the text box to be on top of the image.
Here's the HTML code:
<a href="#">
<img src="http://images.meredith.com/content/dam/bhg/Images/2009/07/101422234.jpg.rendition.200sq.jpg" />
<div class="text">
This is some text.
</div>
</a>
And the CSS styling:
a {
height:400px;
width:200px;
display:block;
text-decoration:none;
color:black;
overflow:hidden;
}
img {
transform: scale(1.1);
}
a:hover .text {
color:white;
background-color:black;
}
.text {
text-align:center;
height:200px;
margin-top:-4px;
background-color:white;
transition:all 1s ease;
}