Learn Basic CSS by Building a Cafe Menu - Step 25

Tell us what’s happening:

I am confused how to do this. I have tried but just can’t seem to get it right

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 (X11; CrOS x86_64 14541.0.0) 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 @whitemeagan73

For this step you need to add the margin-left and margin-right properties to the #menu selector.

Happy coding

Hello this is my code so far , for some reason i can get the left margin to auto but when i try and get the right one to auto im not able to put it anywhere , i tried next to the left margin and underneath on a new line of code but im still getting an error when it try to auto the right margin. Where do i put the right auto margin

}

#menu{
  width: 80%;
  background-color: burlywood;
  margin-left: auto
}```

reply to my own post

#menu{
  width: 80%;
  background-color: burlywood;
  margin-right: auto;  margin-left: auto```
}

i forget the spacing AND colons in the proper place make all the difference.

most of the instructions on freeCodeCamp are very straight forward, so try doing what comes to mind first after reading an instruction, it often is right;

1 Like