Learn Basic CSS by Building a Cafe Menu - Step 17

The hint I am getting is your code should have a link element. What am I doing wrong??

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
  <a href ="styles.css"> 
    <meta charset="utf-8" />
    <title>Cafe Menu</title>
  </head>
  <body>
    <header>
      <h1>CAMPER CAFE</h1>
      <p>Est. 2020</p>
    </header>
    <main>
      <section>
        <h2>Coffee</h2>
      </section>
    </main>
  </body>
</html>
/* file: styles.css */
h1, h2, p {
  text-align: center;
}

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 17

Link to the challenge:

This isn’t the type of link you use to include a style sheet. Read the last two sentences of the instructions again. They are telling you exactly how to do it.

Can you please show me an example of a style sheet link?

I’m sure you can use the googles to find one. But I don’t think you need to do that. Just follow the instructions very carefully.

“Nest a self-closing link element in the head element.”

A link element is just another type of HTML element, just like a body element or meta element. The link element is self-closing, like the meta element, so it doesn’t need a closing tag, just an opening one. You’ve added a meta element already so I am confident you can add a link element.

“Give it a rel attribute value stylesheet and an href attribute value of styles.css.”

These are just attribute/value pairs you add to the opening tag, just like you did with the charset attribute on the meta tag. Follow that same format to add these attributes on the link tag.

1 Like