Learn Basic CSS by Building a Cafe Menu - Step 32

Tell us what’s happening:

Stuck again. Anyone kindly help me out.

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>

<!-- User Editable Region -->

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

<!-- User Editable Region -->

          </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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Safari/605.1.15

Challenge Information:

Learn Basic CSS by Building a Cafe Menu - Step 32

class name should be inside p element…

2 Likes

It really helps if you say more about how you are stuck

2 Likes

hey appreciate your reply. please what p element. and how should it be added?

it says " Add the class name flavor to the French Vanilla p element." I’ve doing that but perhaps I’m doing something wrong.

that’s not how you assign a class to an element, look around the existing code for a refresher if you need to!

3 Likes


Done that but…

Please post your code instead of screenshots

When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

1 Like

Acknowledged. can you kindly assist me with the challenge?

Can you kindly post your code?

You added the class to a brand new div element instead of to the p element that’s there. You shouldn’t make a brand new div element.

2 Likes

do you mean I should add the class to the p element with French Vanilla?

Can you please post your code.

Yes the class needs to be added to the opening p tag.

the code is the screenshot above the chat. is it this .flavor or this class=“flavor” that I should add to the opening p tag?

Please post your code instead of a screenshot. It’s always better to post the actual code instead of a screenshot. We cannot run a screenshot. It’s hard to read pictures.

Try adding the class to the opening p element and post the code.

2 Likes

Tell us what’s happening:

how can I add class name flavor to the p element below.

<p> French Vanilla</p>
<p>3.00</p>

kindly put me through.

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>

<!-- User Editable Region -->

            <p> French Vanilla</p>
            <p> 3.00</p>

<!-- User Editable Region -->

          </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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Safari/605.1.15

Challenge Information:

Learn Basic CSS by Building a Cafe Menu - Step 32
https://www.freecodecamp.org/learn/2022/responsive-web-design/learn-basic-css-by-building-a-cafe-menu/step-32`Preformatted text`

You can add class to the opening tag of a p

2 Likes

Really appreciate. that worked.