Design a Set of Colored Boxes - Design a Set of Colored Boxes

Tell us what’s happening:

Can someone spot the error? Steps 1 & 10 are not working for the background colours…

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Colored Boxes</title>
</head>
<body>
<div class="color-grid">
    <div class="color-box color1">111</div>
    <div class="color-box color2">222</div>
    <div class="color-box color3">333</div>
    <div class="color-box color4">444</div>
    <div class="color-box color5">555</div>
</div>
</body>
</html>
/* file: styles.css */
body {
  background-color: #f4f4f4;
}

.color-box {
  width: 20px;
  height: 20px;
}

.color1 {
  padding: 10px;
  margin: 200px;
  background-color: #ff0000;
}

.color2 {
  background-color: rgb(255, 127, 0);
}

.color3 {
  background-color: yellow;
}

.color4 {
  background-color: hsl(128, 100%, 40%);
}

.color5 {
  background-color: blue;
}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36 Edg/137.0.0.0

Challenge Information:

Design a Set of Colored Boxes - Design a Set of Colored Boxes

should you try linking the stylesheet file?

1 Like