skip to Main Content

I added a picture to describe my problem:

Error

IN the picture you’ll see my HTML code and what the auto grade says I’m doing wrong, but the problem Is that i still have 5 "div" tags in the "body". I don’t get it.

In the picture below you’ll see what the coursera course wants me to do step by step. Help please:

Assignment

I added the "div" tags in "body", I don’t understand.

3

Answers


  1. Probably , you’ve understood the question incorrectly. From my understanding, you need to have 5 <div> tags on top level (i.e. not nested).

    Rough e.g.:

    <body>
        <div>blah 1</div>
        <div>blah 2</div>
        <div>blah 3</div>
        <div>blah 4</div>
        <div>blah 5</div>
    </body>
    

    Note: I’m purposefully not giving you exact answer to your assignment, above hint will help you move forward.

    Login or Signup to reply.
  2. Well, the issue is that the grading system is searching for divs that are directly inside the body tag. The way you have declared them is called nesting, you have basically nested all your divs inside one div: the first div. As only first div is inside the body tag and the rest of divs are inside the div tag, the grading system is not able to find them. You can modify your code so that your divs are in the body tag. Here’s a sample for you

    <body>
    <div>Div1</div>
    <div>Div2</div>
    <div>Div3</div>
    <div>Div4</div>
    <div>Div5</div>
    </body>
    

    I hope this helps

    Login or Signup to reply.
  3. What you have done is you have added nested divs like

    <div>
       content
    <div>
       content
    </div>
    </div>
    

    But they are asking for 5 seperate divs. so you have to close each div before starting the next one.
    Like

    <div> content 1 </div>
    <div> content 2 </div>
    <div></div>
    <div></div>
    <div></div>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search