Learn Basic CSS by Building a Cafe Menu - Step 14- CSS ERROR

h1 {
text-align: center;
}

h2 {
text-align: center;
}

p {
text-align: center;
}

What’s wrong with the css that I typed?

You appear to have created this post without editing the template. Please edit your post to Tell us what’s happening in your own words.
Learning to describe problems is hard, but it is an important part of learning how to code.
Also, the more you say, the more we can help!

It has to be the same selector as in the style element.

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

That is a selector list, not three separate selectors.


If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Help button located on the challenge. This button only appears if you have tried to submit an answer at least three times.

The Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.

you need to copy the exact code you have in the html file, that is not the exact code you have in the html file

I did previously the code that you sent, but it didn’t work

It should pass. Try resetting it and doing it again.

Edit: Just to be clear, by resetting, I mean use the reset button and reload the page. Make sure no saved code is added on reload. Now write the selector, or just copy and paste it from the HTML, and submit it.


It can fail with saved code, not sure why it is happening.

  1. Write the correct selector and save it (Ctrl + S).

  2. Reload the page and submit.

Seems like a bug.

1 Like