Design a Cafe Menu - Step 20

Tell us what’s happening:

It’s saying that “You should move all the other elements inside the new div.” when I already have

my Div element is nested in the Body element so I’m not sue what’s wrong

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>Cafe Menu</title>
    <link href="styles.css" rel="stylesheet"/>
  </head>

<!-- User Editable Region -->

  <body>
    <div id="menu">
      <h1>CAMPER CAFE</h1>
      <p>Est. 2020</p>
      <section>
        <h2>Coffee</h2>
      </section>
    <main>
      </div>
    </main>
  </body>

<!-- User Editable Region -->

</html>
/* file: styles.css */
body {
  background-color: burlywood;
}

h1, h2, p {
  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/138.0.0.0 Safari/537.36

Challenge Information:

Design a Cafe Menu - Step 20
https://www.freecodecamp.org/learn/full-stack-developer/workshop-cafe-menu/step-20

this does not seem correct, should an element have only a closing tag inside?

1 Like

thank you, I never realised that I did that

unfortunately that doesn’t seemed to have worked
I’ve moved the closing Div element out of the main tags, but it still says the same thing


here’s my code now

do I need to move the closing div tag inside the closing section tag?

Add a div element inside the body element and then move all the other elements inside the new div.

This block of the original code should remain unchanged:

<main>
      <h1>CAMPER CAFE</h1>
      <p>Est. 2020</p>
      <section>
        <h2>Coffee</h2>
      </section>
    </main>

but it should be in between the opening and closing div tags. (and all of it between the opening and closing body tags)

2 Likes

so you don’t think that the main is part of “all the other elements”?

I’ve fixed it now, I realised that the contents needed to be inside the “Main” tags while the div goes around the main

Thanks for the help :+1:

1 Like