Learn Basic CSS by Building a Cafe Menu - Step 21

Tell us what’s happening:
Describe your issue in detail here.
so i tried not to use the div but it didnt work since it says that i haven’t used the #menu.
So could someone guide me please
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>
  <body>
    <div id="menu">
      <main>
        <h1>CAMPER CAFE</h1>
        <p>Est. 2020</p>
        <section>
          <h2>Coffee</h2>
        </section>
      </main>
    </div>
  </body>
</html>
/* file: styles.css */

/* User Editable Region */

body {
  background-color: burlywood;
}

h1, h2, p {
  text-align: center;
}
div, 
#menu-id {
  width: 300px;
}

/* User Editable Region */


Your browser information:

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

Challenge: Learn Basic CSS by Building a Cafe Menu - Step 21

Link to the challenge:

1 Like

Hello!

Remove the -id from the #menu selector and it will pass.

This is a confusing step because of how it is worded. It appears the selector should have the -id in it. But, this is not the case.
I do not think the div is needed, either. Just the #menu
Keep up the good progress!

1 Like

thanks im so grateful

1 Like

but why is it they add the -id as part of the test

You are very welcome!
This step catches us all.

Keep up your good progress!

1 Like
#example-id {
  width: 250px;
}

This is potentially confusing I guess.

Here’s a key to CSS selectors:

/* When selecting all elements of a particular element type, use no prefix:
All div elements will have red text */

div {
  color: red;
}

/* When selecting only a specific element by its id attribute, you prefix with a hash:
The element with id="description" will have red text */

#description {
  color: red;
}

/* When selecting all elements which have a specific class attribute, you prefix with a dot:
All elements with class="warning" will have red text */

.warning {
  color: red;
}

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