Skip to content

Instantly share code, notes, and snippets.

@jimmyachour
Last active February 1, 2019 13:39
Show Gist options
  • Save jimmyachour/fcc014056d5c574122ebdc8d31c7d749 to your computer and use it in GitHub Desktop.
Save jimmyachour/fcc014056d5c574122ebdc8d31c7d749 to your computer and use it in GitHub Desktop.
gandalf hover
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Gandalf</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<section>
<img src="http://images.innoveduc.fr/integration_gandalf.png">
<div class="img__descContainer">
<div class="img__descContainer__info">
<p>reward <span>1000</span><br/>golden coins</p>
</div>
<h2>Gandalf</h2>
</div>
<p class="img__descContainer__littleTitle">Gandalf</p>
</section>
</body>
</html>
body{
margin: 0;
padding: 0;
}
section{
width: 500px;
height: 572px;
}
.img__descContainer{
width: 500px;
height: 572px;
position: absolute ;
top: 0;
text-align: center;
}
img{
opacity: 0.5;
}
.img__descContainer__info{
background-color: white;
opacity: 0.6;
width: 95%;
height: 20%;
margin: 15px auto 30px auto;
border-radius: 10px;
text-align: center;
}
.img__descContainer__info p{
font-size: 30px;
line-height: 55px;
}
.img__descContainer__info span{
color: orange;
}
.img__descContainer h2{
font-size: 60px;
color: white;
padding-top: 60px;
}
.img__descContainer__littleTitle {
position: absolute;
bottom:20%;
left: 180px;
font-size: 40px;
color: white;
display: none;
}
section:hover .img__descContainer{
display: none;
}
section:hover img{
opacity: 1;
}
section:hover .img__descContainer__littleTitle{
display: initial;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment