Skip to content

Instantly share code, notes, and snippets.

@Nocktiss
Created February 18, 2019 15:40
Show Gist options
  • Save Nocktiss/365f0938c459fa3ac9465731d3ace237 to your computer and use it in GitHub Desktop.
Save Nocktiss/365f0938c459fa3ac9465731d3ace237 to your computer and use it in GitHub Desktop.
Gandalf + CSS
.hovering
{
position: absolute;
}
img
{
opacity: 0.6;
}
img:hover
{
opacity: 1;
}
.hovering:hover .text
{
font-size: 30px;
top: 88%;
left: 37%;
}
.hovering:hover p
{
opacity: 0;
}
p
{
border-radius: 10px;
padding: 2px 15px 2px;
opacity: 0.8;
position: absolute;
background-color: #ffffff;
font-size : 40px;
top: 0%;
left: 25%;
}
.text {
position: absolute;
top: 50%;
left: 22%;
text-align: center;
font-size: 80px;
color: white;
}
span
{
color: orange;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="gandalf.css">
<title> Gandalf </title>
</head>
<body>
<div class="hovering">
<img src="http://images.innoveduc.fr/integration_gandalf.png" alt="gandalf_picture">
<div class="text"><b>Gandalf</b></div>
<p> reward <b><span>1000</span></b><br /> golden coins </p>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment