Learn Basic CSS by Building a Cafe Menu - Step 12

Tell us what’s happening:
Center the h2 and p elements by adding a new type selector for each one to the existing style element.

The error message tells me that I cannot change the existing h1 selector. But I am also not allowed to add new rules for the other type selectors with the same properties and values.
Your code so far

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>Cafe Menu</title>
    <style>
      h1,h2,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/106.0.0.0 Safari/537.36

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

Link to the challenge:

The instruction: " Center the h2 and p elements by adding a new type selector for each one to the existing style element. " For each one separately. You did it right but it is not what you are supposed to do in this step.

Okay so then I try this:

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

and it replies I cannot a

add style tags. How do I add elements to the existing style element?

Your code is ok now. restart the step and type in the whole line between ‘style’ tags.

  p { text-align: center; }
</style>

CAMPER CAFE

Est. 2020

Coffee

Test
Sorry, your code does not pass. Keep trying.

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

Your code passes for me on a up-to-date version of Chrome without extensions.

Oh ok thank you for your time!

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