Learn Basic CSS by Building a Cafe Menu - Step 12

Tell us what’s happening:
Describe your issue in detail here.
how can I have an h1 selector in my style element.
Your code so far

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <title>Cafe Menu</title>
  <style>{<h1>CAMPER CAFE</h1>
  property:value;center
  }
  </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/103.0.0.0 Safari/537.36

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

Link to the challenge:

Hello, the instruction is to style the h1 element, you need to first link your html and css together. After which you will the use the format:

element {
 property: value;
}

To style any desired element.

link your html to your css using the element.

how do i do that. :face_with_raised_eyebrow:
please explain

I will give some style to some random element using example above:

form {
  font-size: 16px;
}

Any questions about elements properties and/or values?

1 Like
type or paste code here
```    <style>
      h1{CAMPER CAFE
      text-align:"center"
      }h1
    </style>
  </head>
see what i tried out but it says Your `text-align` property should have a value of `center` .

the CAMPER CAFE part - it’s the content inside h1. You don’t need to copy content of an element in the selector.

also h1 after the} - you don’t need that. CSS selectors don’t have closing tags.

Another example:
HTML:

<p>bunch of text content</p>

style for p:

p {
  text-align: left;
}
2 Likes

Remove this " and it will work

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