I got the text to be on top of the image, and the image to disappear on hover (opacity).
But I can't get the text not to show up on top of the image in the first place.
I tried using the z-index to put it lower than the image z-index, and I also tried to change the text opacity on hover (having it set to 0 on "not hover"), but neither worked.
CSS:
Code:
#small ul {
list-style: none;
margin-top: 50px;
}
#small ul li {
display: inline-block;
float: right;
margin: -7px 0 0;
width:25%;
}
#small ul li img {
width: 100%;
}
#small img:hover {
opacity: 0;
-webkit-transition: all 300ms ease;
-moz-transition: all 300ms ease;
-ms-transition: all 300ms ease;
-o-transition: all 300ms ease;
transition: all 300ms ease;
}
#small h2 {
position: absolute;
top: 25%;
text-align: center;
font-weight: 500;
font-size: 2.1em;
color: #333;
}
.smallclass {
position: relative;
width:100%;
text-align: center;
}
HTML:
Code:
<div id="small">
<ul>
<li class="smallclass">
<a href="some.html"><h2>description</h2>
<img src="image.jpg" alt="something"></a>
</li>
<li class="smallclass">
<a href="some.html"><h2>description</h2>
<img src="image.jpg" alt="something"></a>
</li>
</ul>
</div>
Bookmarks