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

Tell us what’s happening:
Describe your issue in detail here.
I have tired a few different ways, it keeps saying The two new “divs” need to be inside the container div and I believe it is… also why can’t they all be inside one closed /div that makes since to me

  **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">
      <div class="marker">
        <div class="marker">
          </div>
          </div>
    </div>
  </div>
</body>
</html>
/* file: styles.css */
h1 {
text-align: center;
}

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

  **Your browser information:**

User Agent is: Mozilla/5.0 (iPhone; CPU iPhone OS 15_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6.1 Mobile/15E148 Safari/604.1

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

Link to the challenge:

Your 3 marker div is “technically” inside the container div but i think the question wants you to place the marker div adjacent to each other meaning, the marker divs are not inside another marker divs.

These are the lines you added.
Unfortunately these lines count as only one “div element”.
I know that is confusing as you see 2 new div starting tags and 2 new div ending tags. So it seems you added 2. But no. Only one here.

An element in html is made up of the starting tag and the ending tag that matches it. Everything in between those two becomes part of the element. (And therefore the whole thing is still one element)

Another way to say this is: in your code snipped above, the first line starts the element, the second line doesn’t end it so it doesn’t count, the third line doesn’t end it either (it ends the nested div just prior). Then the fourths line finally ends the element! Therefore you only created one div element (with a nested div inside).

If you create two separate elements, then you should pass the test.

1 Like

You dumbed that down for me so much thank you kindly

That makes me feel bad though! I hope my explanation did not disrespect your intelligence. Please forgive me if so.

1 Like