Learn CSS Colors by Building a Set of Colored Markers - Step 16

Tell us what’s happening:
Describe your issue in detail here.
hi i have been asked to add a class one to the first div element. i am lost did all that i thought was write. kindly help.

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 Markers</title>
    <link rel="stylesheet" href="styles.css">
  </head>
  <body>
    <h1>CSS Color Markers</h1>
    <div class="container">
      <div class="marker" class-1>
      </div>
      <div class="marker">
      </div>
      <div class="marker">
      </div>
    </div>
  </body>
</html>
/* file: styles.css */
h1 {
  text-align: center;
}

.marker {
  width: 200px;
  height: 25px;
  background-color: red;
  margin: 10px auto;
}

Your browser information:

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

Challenge: Learn CSS Colors by Building a Set of Colored Markers - Step 16

Link to the challenge:

I think using the image here will help you understand where you went wrong.

Do you see the example in the screenshot? <div class="animal dog">
This example shows you how to set more than one class value for an element. ( in this case we say that the div is of class animal and of class dog).

Then in the same screenshot the instructions say to add a class one
Look at how it is coloured? This should tell you that you need this word one in your code.

hope this helps you see what you did wrong

1 Like

You can only have one class attribute on a tag. So all class names need to be added to the same class attribute. Look at the example in the instructions for how to add multiple class names to an element.

Also, they are asking you to add the class name one, not the number 1.

thanks. i did it and it worked

1 Like