Learn Basic CSS by Building a Cafe Menu - Step 11

**Tell us what’s happening:**i’m having trouble setting the text-align property to the value center
could you possibly give me a guide in solving this ?
Describe your issue in detail here.

Your code so far

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />

<!-- User Editable Region -->

    <title>Cafe Menu</title>
    <style>
      <h1> { 
        text-align: center;
        } </h1>
    </style>

<!-- User Editable Region -->

  </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/115.0.0.0 Safari/537.36 Edg/115.0.1901.200

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

Link to the challenge:

styling is done with the CSS language and the actual creating the elements of a page is done with Html code. As such the SCC syntax for styling an element is typing your element (if your styling a class you type a dot followed by the class name)followed by a set of curly brackets and then the attributes name, a colon and lastly a semi colon to show that you’ve reached the end of your statement.
example:
button{color;red}
or for a class:
.text{color:red;}

1 Like

all have to be inside the style element?

When selecting an element, you don’t need the 2 angle brackets (<>).
An example of some css code aligning a paragraph to the left.

p {
text-align: left;
}
2 Likes

thanks that helped alot

The style element is to show that all code inside is the styling of the webpage kinda like the head and body elements. Later on in the course you will style your page on a separate document and provide a link to that page.

1 Like

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