Skip to content

Instantly share code, notes, and snippets.

@bcho
Forked from Kaiyuan/Hover-Box.html
Created July 26, 2012 12:29
Show Gist options
  • Save bcho/3181759 to your computer and use it in GitHub Desktop.
Save bcho/3181759 to your computer and use it in GitHub Desktop.
Hover-Box
<div class="box">
<img class="image" src="https://dl.dropbox.com/u/6450050/demo/music-player-air/images/359167072-1.jpg" alt="">
<div class="text">
<h2>title</h2>
<p>This's Photo.</p>
</div>
</div>
<style type="text/css">
.box {
width: 100px;
height: 100px;
position: relative;
overflow: hidden;
line-height: 100px;
text-align: center;
}
.box img {
max-width: 100px;
max-height: 100px;
}
.text {
position: absolute;
transition: all .3s;
-webkit-transition: all .3s;
-moz-transition: all .3s;
width: 100px;
top: 100px;
min-height: 100px;
background-color: rgba(0,0,0,0.6);
line-height: 24px;
}
.box:hover .text {
top: 0px;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment