- index.html
- style.css
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The background Property</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="block block1">
Hypnocat
</div>
<div class="block block2">
Fishcat
</div>
</body>
</html>
CSS
body {
padding: 20px;
font-size: 20px;
font-family: "Tahoma", sans-serif;
}
.block {
width: 140px;
margin: 25px auto;
padding: 25px 0;
padding-left: 90px;
color: white;
border-radius: 5px;
box-shadow: 1px 1px 3px #999999;
}
.block1 {
background: none;
}
.block2 {
background: none;
}
You’ve gone to a different page
Goalscompleted
0
- Set the background for the first block as follows: background color
#e74c3c
, imagecat_eyes.png
, no repeat, and image offset of10px
to the left and5px
up. - Set the background for the second block as follows: background color
#2980b9
, imagecat_fish.png
, no repeat, and image offset of5px
up.
Comments