- index.html
- style.css
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<title>On-hover effects: the gallery</title>
<meta charset="utf-8">
<link rel="stylesheet" href="style.css">
</head>
<body>
<ul class="deck">
<li><img class="ten" src="cards/10.png" alt="Ten"></li>
<li><img class="queen" src="cards/queen.png" alt="Queen"></li>
<li><img class="king" src="cards/king.png" alt="King"></li>
<li><img class="ace" src="cards/ace.png" alt="Ace"></li>
<li><img class="ten" src="cards/10.png" alt="Ten"></li>
<li><img class="jack" src="cards/jack.png" alt="Jack"></li>
<li><img class="queen" src="cards/queen.png" alt="Queen"></li>
</ul>
</body>
</html>
CSS
body {
margin: 0;
padding: 0;
background-color: #f5f5f5;
}
.deck {
list-style: none;
}
.deck > li {
position: relative;
display: inline-block;
margin: 0 20px 20px 0;
}
.deck img {
width: 100px;
transition: all 0.1s linear;
}
.deck img:hover {
}
You’ve gone to a different page
Goalscompleted
0
- For
.deck img:hover
, assign the value0.6
toopacity
. - Also increase
scale
to the value1.1
.
After you complete every change, hover the cursor over any card to check your work.
Comments