Learn Basic CSS by Building a Cafe Menu - Step 7

Tell us what’s happening:

I have admittedly already completed this lesson several times, but I have a silly question;

Why am I using a p element instead of h2? Just curious because I remember the course telling me that h1 - h6 describe the level of importance of text in your code. Just trying to get a better understanding of why it’s better to do it with a paragraph instead of a header.

Your code so far

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>Cafe Menu</title>
  </head>
  <body>
    <main>

<!-- User Editable Region -->

      <h1>CAMPER CAFE</h1>
      <p>

<!-- User Editable Region -->

    </main>
  </body>
</html>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:129.0) Gecko/20100101 Firefox/129.0

Challenge Information:

Learn Basic CSS by Building a Cafe Menu - Step 7

1 Like

i guess whoever created this course felt that the current text is not of ‘header’ level type importance.

1 Like

Thank you for the response. So essentially the h2 COULD technically work and there’s nothing inherently wrong with using a header there? It’s just a matter of preference with organization?

yeah of course you can use an h2 to create a sub-level header.

Deciding which tag to use is a little bit of an art. You need to weigh the ‘semantics’ of the tag (what it means to use it) and its effect on people and programs that read your code.

1 Like

Perfect. I knew it was probably a silly question but I wanted to double check in case I was misunderstanding something :slight_smile:

no it is not a silly question.
You’re ahead of the curve for asking it this early though.

1 Like