Basic CSS Step 33

Ok so, idk what a “class” is supposed to look like and what’s supposed to happen here is that I add the “class name” flavor to the “p” element and I’m not exactly sure where to put it.

  **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">
    <header>
      <h1>CAMPER CAFE</h1>
      <p>Est. 2020</p>
    </header>
    <main>
      <section>
        <h2>Coffee</h2>
        <article>
          <p>French Vanilla</p>
          <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 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.3 Safari/605.1.15

Challenge: Step 33

Link to the challenge:

Hello,

A class is an attribute of an html tag that will have a value. When setting attributes for html tag they should look like this
<tag attribute="value">Visible Text</tag>

1 Like

When you did the menu you added the class like this

<div class="menu">

With the word ‘class’ and the value ‘menu’ after the name of the element, ‘div’.

So if this is how you add a class to a div, how would you add a class to a p element with the same formatting?

1 Like

Thanks ( ^ω^ ) I’m kind of barely surviving on coffee currently which is probably why my question was… kinda dumb

1 Like

Thanks dude :smiling_face: finally got past that one

2 Likes

Hey there’s no such thing as a dumb question!

Now you know for future how to add classes, which means you can apply this to many future lessons.

If you’ve learned something it’s a good question. :smiley:

1 Like

Yeah I really needed that :sweat_smile:

1 Like