Learn Basic CSS by Building a Cafe Menu - Step 32

Add the class name flavor to the French Vanilla p, this is what they asked for so I created a .flavor{} with the <p> tags inside, got this wrong. Then I switched to <div> tags inside the <p> tag, wrong again so i added everything inside a div tag.

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Cafe Menu</title>
    <link href="styles.css" rel="stylesheet"/>
  </head>
  <body>
    <div class="menu">
      <main>
        <h1>CAMPER CAFE</h1>
        <p>Est. 2020</p>
        <section>
          <h2>Coffee</h2>
          <article>
            <div class="flavor">
            <p>French Vanilla</p>
            </div>
            <p>3.00</p>
          </article>
          <article>
            <p>Caramel Macchiato</p>
            <p>3.75</p>
          </article>
          <article>
            <p>Pumpkin Spice</p>
            <p>3.50</p>
          </article>
          <article>
            <p>Hazelnut</p>
            <p>4.00</p>
          </article>
          <article>
            <p>Mocha</p>
            <p>4.50</p>
          </article>
        </section>
      </main>
    </div>
  </body>
</html>
/* file: styles.css */
body {
  background-image: url(https://cdn.freecodecamp.org/curriculum/css-cafe/beans.jpg);
}

h1, h2, p {
  text-align: center;
}

.menu {
  width: 80%;
  background-color: burlywood;
  margin-left: auto;
  margin-right: auto;
}

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64; rv:105.0) Gecko/20100101 Firefox/105.0

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

Link to the challenge:

you should add the class to the p opening tag

Make sure you use the value that they requested.

<p> <class="flavor">
              French Vanilla</p>
            <p>3.00</p>

still wrong

let me ask you, is ‘class’ an HTML element or an HTML attribute?
What is the difference do you think in these two?

<p> <div class="flavor">
              French Vanilla</p>
              </div>
            <p>3.00</p>

An attribute because it’s part of the syntax

yes class is an attribute.
In your response you showed me how to add class=“flavor” to a div element.
But that’s not the request here.
They want you to add it to the paragraph element…

All I needed to do was remove > from the first p tag.

Not quite. You would have to remove the > and the < in the middle between the p and the class.

It’s important to spend some time and try to understand the difference between elements and attributes though. (elements are the words that come right after <)

That might be a bug i got it right with a < still on the class. Question 34 needed it to be like this tho

can I see a screenshot?

I’m on question 36 right now but I’ll try to see if it happens again

It didn’t happen again. It’s probably because I restarted around 100 times

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