Learn Basic CSS by Building a Cafe Menu - Step 12 - Hcw2_LcwbPbiUNo4HhXWK

Tell us what’s happening:
Describe your issue in detail here.

Greetings All,

I am attempting to Center an h1 element by setting its text-align property to the value center . This is in reference to the 8th line of code; beginning with “<h1 text-align…” I have been moving fairly well up until this point and cannot seem to figure out where I am stumbling. I would greatly appreciate anyone taking the time to share some pointers with me.

Thanks in advance,
Ralph

  **Your code so far**
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <title>Cafe Menu</title>
  <style>
    <h1 text-align="center">element {property: value;}</h1>
  </style>
</head>
<body>
  <header>
    <h1>CAMPER CAFE</h1>
    <p>Est. 2020</p>
  </header>
  <main>
    <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/102.0.5005.63 Safari/537.36 Edg/102.0.1245.39

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

Link to the challenge:

So CSS is written a little bit differently than HTML. I think this is the first step to introduce CSS, right? So I can definitely understand the confusion. In CSS, we don’t use tags like we do in HTML. We can just use the elements name to style a specific element. So instead of <h1> we would just use h1 in CSS. That’s what the example CSS code is trying to show you:

element {
 property: value;
}

The element in this case would be the name of the element you want to style (such as h1). Then inside those curly braces is where you set the styles using the property: value format, where property is the name of a CSS property and value is the value you want to give it.

Based on the above, do you think you could take another try at this? And if it still doesn’t work then you can paste your updated code in here and we can go from there.

To display your code in here you need to wrap it in triple back ticks. On a line by itself type three back ticks. Then on the first line below the three back ticks paste in your code. Then below your code on a new line type three more back ticks. The back tick on my keyboard is in the upper left just above the Tab key and below the Esc key.

I greatly appreciate that my man. It took me a second to even decipher what you meant; but the old gears got to turning and I finally was able to see what you mean. again; I really appreciate that…

Ralph

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