Learn Basic CSS by Building a Cafe Menu - Step 12

Tell us what’s happening:
I am not sure what I am doing wrong here.

The prompt was:
In the previous step, you used a type selector to style the h1 element. Center the h2 and p elements by adding a new type selector for each one to the existing style element.

I keep getting the error:
Test
Sorry, your code does not pass. Don’t give up.

Hint
You should not add a new style tag. Add the new CSS rules to the existing style tag.

Your code so far

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>Cafe Menu</title>
    <style>
      h1 {
        text-align: center;
      }
      h2 {
        text-align: center;
      }
      p {
        text-align: center;
      }
    </style>
  </head>
  <body>
    <main>
      <h1>CAMPER CAFE</h1>
      <p>Est. 2020</p>
      <section>
        <h2>Coffee</h2>
      </section>
    </main>
  </body>
</html>

Your browser information:

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

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

Link to the challenge:

Welcome to our community!
The code is correct. Restart the step and do it again. If that doesn’t work, follow the instruction:
“Note: Some browser extensions, such as ad-blockers and dark mode extensions can interfere with the tests. If you face issues, we recommend disabling extensions that modify the content or layout of pages, while taking the course.”

1 Like

Thank you. Restarting it fixed the issue.

1 Like

You were writing the CSS code in the HTML file. That caused the issue.

Make sure that you don’t write CSS syntax on HTML files and vice versa.