Learn Basic CSS by Building a Cafe Menu - Step 25

Tell us what’s happening:

For each of these challenge instructions, I wish it would clarify as to where the edits are expected. For example, I am not clear whether to apply the [margin-left: auto] and [margin-right: auto] within the index.html or the styles.css as both contain code for the body element.

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;
  */
  margin-left: auto;
  margin-right: auto;
}

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/128.0.0.0 Safari/537.36

Challenge Information:

Learn Basic CSS by Building a Cafe Menu - Step 25

1 Like

In the styles.css, fellow coder. CSS always goes there on fCC projects unless otherwise specified. In order to put them in the index.html, we would need <style> tags, which are not there, or add it as a style attribute to the element, which was not in the instructions.

“…center the #menu element within the body element.” - I can see where that could be a bit confusing, but usually when there is a separate .css file, the styles go there.

Hope that helped!