Learn Basic CSS by Building a Cafe Menu - Step 25

Tell us what’s happening:

I’m looking for help as I don’t seem to understand. Can anyone please explain this format and possibly link a page that further explains #menu and it’s mechanics. Thank you so much!

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 */
body {
  /*
  background-color: burlywood;
  */
}

h1, h2, p {
  text-align: center;
}


/* User Editable Region */

#menu {
  width: 80%;
  background-color: burlywood;
}

/* User Editable Region */

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36

Challenge Information:

Learn Basic CSS by Building a Cafe Menu - Step 25

hi there,

I don’t see any new code showing what you attempted to do?
We need you to show us your attempt(s) first.

My apologies, it seems I may have reset the code I will attempt to reupload after my next attempt thanks

Hello!

This step is asking us to center the #menu by setting the ‘margin-left’ property to a value of ‘auto’
and setting the ‘margin-right’ property to a value of ‘auto’

Example:
img {
border-top: auto;
border-bottom: auto;

Here img is the element. border-top and border-bottom are the property and auto is the value.

element{
property: value;
}

Since we already have the #menu element with some properties and values, we need to add this margin-left and margin-right properties and values within the existing #menu selector.

I hope this helps you.

As for more knowledge about how things are centered, I found the following link that may help in your projects, and help to understand centering things in CSS.

1 Like

Thank you so much for the help!

1 Like

You are very welcome!

Wishing you more good progress on your coding journey. :slightly_smiling_face:

1 Like