Learn Basic CSS by Building a Cafe Menu - Step 11

Tell us what’s happening:
I dont understand how i should put a style element and h1 element with the value. Please help.

Your code so far

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

Your mobile information:

SM-A135F - Android 13 - Android SDK 33

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

Link to the challenge:

CSS doesn’t use HTML tags. So if you ever find yourself putting HTML tags in your CSS then stop immediately and remove them :slightly_smiling_face:

Let’s look at the example again:

element {
 property: value;
}

element is the element in the HTML you want to style. But again, just because it uses HTML tags in the HTML doesn’t mean you want to use HTML tags in the CSS. Instead, you just use the name of the element.

property is the name of the property you want to change for the element.

value is the actual value you want to give the property.

So you just need to replace these three words in the example CSS with what the instructions are asking you to make them.

“Center your h1 element by setting its text-align property to the value center.”

Do you understand from these instructions what is the element, property, and value?

And so how should i center my h1 element by setting its text-align property to the value center?

Well, I can’t just show you how to do that. I’ll try to explain again. Look at the example CSS:

element {
 property: value;
}

You need to replace each of the words in this example (element, property, and value) with the words (or values) the instructions are asking you to use. Leave everything else as is (such as the curly braces, colon, and semi-colon). All of it goes between the opening <style> tag and closing </style> tag.

These are the instructions:

“Center your h1 element by setting its text-align property to the value center.”

Do you understand from these instructions what you would use to replace element, property and value?

1 Like

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