Learn basic css by building a cafe menu step 20

I am struggling with this step and dont know if the div attribute and ID element is correct, please can anyone help

Step 20

The div element is used mainly for design layout purposes unlike the other content elements you have used so far. Add a div element inside the body element and then move all the other elements inside the new div.

Inside the opening div tag, add the id attribute with a value of menu.

my code:

Cafe Menu
id="menu"

CAMPER CAFE

Est. 2020

Coffee

In the future, please use the Help button in the step to ask a question in here because it will automatically include your code. Since we are passed that, you need to paste your code in here correctly so we can see the actual HTML instead of how it is displayed in the browser. Please follow the below method to paste your HTML in here.

To display your code in here you need to wrap it in triple back ticks. On a line by itself type three back ticks. Then on the first line below the three back ticks paste in your code. Then below your code on a new line type three more back ticks. The back tick on my keyboard is in the upper left just above the Tab key and below the Esc key. You may also be able to use Ctrl+e to automatically give you the triple back ticks while you are typing in the this editor and the cursor is on a line by itself. Alternatively, with the cursor on a line by itself, you can use the </> button above the editor to add the triple back ticks.

Thank you, i hope this is what you meant:

<!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>
  <body>
    <div> id="menu"
    <main>
      <h1>CAMPER CAFE</h1>
      <p>Est. 2020</p>
      <section>
        <h2>Coffee</h2>
      </section>
    </main>
    </div>
  </body>
</html>
1 Like

Yes, that is how you paste your code in here!

“Inside the opening div tag, add the id attribute with a value of menu.”

Notice the phrase “Inside the opening div tag”. Where did you put the id attribute? To me it looks outside of the opening div tag instead of inside of it.

The id attribute is just another attribute, like the href attribute you have previously added to the link tag above. Where did you add the href attribute? Use that as an example of where to add the id attribute on the div.

2 Likes

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