Skip to content

Instantly share code, notes, and snippets.

@MartinsAlexandre
Last active February 15, 2018 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MartinsAlexandre/b5158305994dcdd0e5500dbd073cd78c to your computer and use it in GitHub Desktop.
Save MartinsAlexandre/b5158305994dcdd0e5500dbd073cd78c to your computer and use it in GitHub Desktop.
Gandalf
* {
font-family: sans-serif;
}
.imageCtn {
position: relative;
}
.imageCtn img {
position: absolute;
width: 400px;
height: 500px;
}
.wanted {
position: absolute;
width: 400px;
height: 500px;
z-index: 1;
background-color: rgba(200, 200, 200, 0.5);
}
.inner {
position: absolute;
left: 20px;
top: 20px;
width: 350px;
height: 130px;
background-color: rgba(255, 255, 255, 0.8);
border-radius: 20px;
color: black;
font-size: 2.5em;
text-align: center;
display: flex;
flex-direction: column;
justify-content: center;
}
.inner span {
color: orange;
}
.name {
position: absolute;
left: 50px;
top: 170px;
color: white;
font-size: 80px;
text-align: center;
}
.wanted:hover {
background-color: rgba(0, 0, 0, 0);
}
.wanted:hover .inner {
display: none;
}
.wanted:hover .name {
top: 400px;
left: 140px;
font-size: 2em;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Gandalf</title>
<link rel="stylesheet" href="../css/gandalf.css" />
</head>
<body>
<div class="imageCtn">
<img src="http://images.innoveduc.fr/integration_gandalf.png" alt="image de gandalf">
</div>
<div class="wanted">
<div class="inner"><p>reward <span>1000</span><br />golden coins</p></div>
<p class="name">Gandalf</p>
</div>
</body>
</html>
</body>
</html>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment