# 通过创建咖啡店菜单学习基础 CSS - 步骤 33

**URL:** <https://forum.freecodecamp.org/t/css-33/715041>\
**Category:** General\
**Tags:** chinese-中文\
**Created:** [October 6, 2024, 1:10pm UTC](https://forum.freecodecamp.org/t/css-33/715041 "2024-10-06T13:10:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![1423902136](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/1423902136/32/372690_2.png) [@1423902136](https://forum.freecodecamp.org/u/1423902136)\
**Post date:** [October 6, 2024, 1:10pm UTC](https://forum.freecodecamp.org/t/css-33/715041/1 "2024-10-06T13:10:20Z")

</div>

### 告诉我们发生了什么：

如何设置选择器 选择器是什么

### 到目前为止你的代码

```html
<!-- 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>
            <p class="flavor">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>

```

```css
/* 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;

/* User Editable Region */

class:favor {
  text-align:left;
}

/* User Editable Region */

```

### 你的浏览器信息：

用户代理是： `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0`

### 挑战信息：

通过创建咖啡店菜单学习基础 CSS - 步骤 33

> **[freeCodeCamp.org](https://www.freecodecamp.org/chinese/learn/2022/responsive-web-design/learn-basic-css-by-building-a-cafe-menu/step-33)**
>
> 免费学习编程

---

<div class="post-metadata">

**Author:** ![hbar1st](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/hbar1st/32/372649_2.png) [@hbar1st](https://forum.freecodecamp.org/u/hbar1st)\
**Post date:** [October 6, 2024, 1:36pm UTC](https://forum.freecodecamp.org/t/css-33/715041/2 "2024-10-06T13:36:35Z")

</div>

> [@1423902136](#):
>
> ```auto
> .menu {
> width: 80%;
> background-color: burlywood;
> margin-left: auto;
> margin-right: auto;
> 
> /* User Editable Region */
> 
> class:favor {
> text-align:left;
> }
> 
> ```

compare the way you wrote the code with the way the code is written for selecting the .menu class above.  
Notice the differences?

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 16, 2026, 5:20pm UTC](https://forum.freecodecamp.org/t/css-33/715041/3 "2026-01-16T17:20:13Z")

</div>

Closed on January 16, 2026, 5:20pm UTC


