Check out this Example
Here is the HTML code:
<ul class="img-list">
<li>
<img src="http://s11.postimg.org/ynw9rnexf/Cetina_river.jpg" width="360px" height="280px" />
<span class="text-content"><span>
Text To Display</span></span>
</li>
</ul>
This is the CSS used:
ul.img-list {
list-style-type: none;
margin: 0;
padding: 0;
text-align: center;
}
ul.img-list {
display: inline-block;
height: 150px;
margin: 0 5px 1em 0;
position: relative;
width: 360px;
margin-top:-5px;
}
span.text-content {
background: rgba(0, 0, 0, 0.5);
color: white;
cursor: pointer;
display: table;
height: 150px;
left: 0;
position: absolute;
top: 0;
width: 150px;
}
span.text-content span {
display: table-cell;
text-align: center;
vertical-align: middle;
}
span.text-content {
background: rgba(0, 0, 0, 0.5);
color: white;
cursor: pointer;
display: table;
height: 150px;
left: 0;
position: absolute;
top: 0;
width: 150px;
opacity: 0;
}
ul.img-list li:hover span.text-content {
opacity: 1;
}
span.text-content {
background: rgba(0, 0, 0, 0.5);
color: white;
cursor: pointer;
display: table;
height: 280px;
left: 0;
position: absolute;
top: 0;
width: 360px;
opacity: 0;
-webkit-transition: opacity 500ms;
-moz-transition: opacity 500ms;
-o-transition: opacity 500ms;
transition: opacity 500ms;
font-family: Droid Arabic Kufi;
font-size: xx-large;
}
When hovering over the image, a text is displayed above it. I want the text to be fixed at the bottom of the image and move to the top when hovered over.
I want the last 50px
of the image to have a black background with the text constantly visible, and to switch to the same functionality on hover.
Your advice on achieving this would be greatly appreciated.