Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  
  <div id="parent">
    <img src="http://lorempixel.com/200/200/" alt="Sport">
    <div class="text">
      This is a text.
    </div>
  </div>
  
</body>
</html>
 
* {
  padding: 0;
  margin: 0;
}
#parent {
  overflow: hidden;
  width: 200px;
  height: 200px;
}
.text {
  position: relative;
  -webkit-transition: .3s all;
  -moz-transition: .3s all;
  transition: .3s all;
  background-color: rgba(255,255,255,.5);
  height: 40px;
  line-height: 40px;
  text-align: center;
  font-weight: bold;
  font-family: verdana;
}
/*******************************************/
#parent img:hover + .text {
  top: -40px;
}
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
qolamipro
0viewers