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

I have looked this up for a hour and I’ve tryed everyway suggested do to this:
Next, within the div , add another div element and give it a class of marker .

Your new div element should have a closing tag

  **Your code so far**
/* file: index.html */
<!DOCTYPE html>
<html lang="en">
  <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">
  <h1>CSS Color Markers</h1>
  <div class="container">
  <div class="marker"/div>
/* file: styles.css */
h1 {
text-align: center;
  **Your browser information:**

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

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

Link to the challenge:

“Hint: Your new div element should have a closing tag.”

The hint is exactly right. A div element has both an opening <div> tag and closing </div> tag. Notice that a tag always starts with < and ends with >. Do both of the tags that you added start and end with the proper characters?

1 Like

thank you can you please explain to me how this works? why the need for 2 closing tags, when one is nested in the other? I wrote it this way 5 times and it said it was wrong , adding spaces helped :expressionless:

If they didn’t, how would you nest other elements inside of them? How would you tell where they start and end?

UPDATE: I think maybe I read your question wrong? You are asking about two closing tags? I’m not sure what you mean by this. I never said they needed two closing tags. I said a div needs an opening and closing tag. I think that’s what you intended to do, but you didn’t get the syntax right. You are missing some angle brackets.

1 Like

I am probably asking wrong…I thought nesting was <>
I am past it now but im confused I guess

Nesting is putting one element inside of another. For example, up to this point you have nested several meta elements, the title element, and a link element in the head element. Do you see how those nested elements are in between the opening and closing head tags?

1 Like

yes thank you, its because they asked me to nest a div inside another div making it look like two div closing tags at the end.

Ahh, I think I understand now. Yes, there will be two </div> closing tags, one right after the other because you are nesting one div inside of another. The important thing is that each of those divs has their own pair of opening and closing tags.


thank you for your help

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.