# 通过编写咖啡店菜单学习基础 CSS - 步骤 40

**URL:** <https://forum.freecodecamp.org/t/css-40/608286>\
**Category:** General\
**Tags:** chinese-中文\
**Created:** [May 5, 2023, 12:37pm UTC](https://forum.freecodecamp.org/t/css-40/608286 "2023-05-05T12:37:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yiweixia](https://avatars.discourse-cdn.com/v4/letter/y/5daacb/32.png) [@yiweixia](https://forum.freecodecamp.org/u/yiweixia)\
**Post date:** [May 5, 2023, 12:37pm UTC](https://forum.freecodecamp.org/t/css-40/608286/1 "2023-05-05T12:37:32Z")

</div>

**告诉我们发生了什么：**  
按照说明已经删除了价格引用的类，也去掉了p之间的空格，还需要什么操作吗？

**你目前的代码**

```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 class="item">

<!-- User Editable Region -->

            <pclass="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>

```

```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;
}

.item p {
  display: inline-block;
}

.flavor {
  text-align: left;
  width: 49%;
}

.price {
  text-align: right;
  width: 49%;
}

```

**你的浏览器信息：**

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

**挑战：** 通过编写咖啡店菜单学习基础 CSS - 步骤 40

**挑战的链接：**

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

---

<div class="post-metadata">

**Author:** ![stephenmutheu](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/stephenmutheu/32/421476_2.png) [@stephenmutheu](https://forum.freecodecamp.org/u/stephenmutheu)\
**Post date:** [May 5, 2023, 1:12pm UTC](https://forum.freecodecamp.org/t/css-40/608286/2 "2023-05-05T13:12:20Z")

</div>

看起来你在你的代码中删除了很多文本，我建议你重新设置你的课程并移动 `<p>` 元素，使它们在同一行上，不要将它们隔开。

---

<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 7, 2025, 12:01pm UTC](https://forum.freecodecamp.org/t/css-40/608286/3 "2025-01-07T12:01:39Z")

</div>


