- index.html
- style.css
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The PNG-8 Format</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="box box1">
<div class="block"></div>
</div>
<div class="box box2">
<div class="block"></div>
</div>
<div class="box box3">
<div class="block"></div>
</div>
</body>
</html>
CSS
.box {
width: 300px;
height: 140px;
margin: 20px auto;
box-shadow: 1px 1px 3px #999999;
}
.box1 {
background-color: #2ecc71;
}
.box2 {
background-color: #f1c40f;
}
.box3 {
background-image: linear-gradient(to bottom, #2ecc71, #f1c40f);
}
.block {
height: 134px;
background-repeat: no-repeat;
background-position: 50% 50%;
}
You’ve gone to a different page
Goalscompleted
0
- Set the background image
cat_cage_8.png
to the elements with the classblock
. - Then assign them the other image
cat_cage_8_no_mate.png
without an outline.
Comments