- index.html
- style.css
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The background-image Property</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="block block1"></div>
<div class="block block2"></div>
<div class="block block3"></div>
<div class="block block4"></div>
</body>
</html>
CSS
body {
padding: 10px;
text-align: center;
}
.block {
display: inline-block;
width: 192px;
height: 192px;
margin: 5px;
border-radius: 5px;
box-shadow: 1px 1px 3px #999999;
}
.block1 {
background-color: #2ecc71;
}
.block2 {
background-color: #3498db;
}
.block3 {
background-color: #e74c3c;
}
.block4 {
background-color: #e67e22;
}
You’ve gone to a different page
Goalscompleted
0
Add background images to the blocks:
cat_box.png
— To the first block,cat_fish.png
— To the second block,cat_drunk.png
— To the third block,cat_tied.png
— To the fourth block.
Comments