# Step 22 in styles.css

**URL:** <https://forum.freecodecamp.org/t/step-22-in-styles-css/518350>\
**Category:** Curriculum Help\
**Tags:** css, html\
**Created:** [June 15, 2022, 1:25pm UTC](https://forum.freecodecamp.org/t/step-22-in-styles-css/518350 "2022-06-15T13:25:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![diosa](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/diosa/32/265370_2.png) [@diosa](https://forum.freecodecamp.org/u/diosa)\
**Post date:** [June 15, 2022, 1:25pm UTC](https://forum.freecodecamp.org/t/step-22-in-styles-css/518350/1 "2022-06-15T13:25:26Z")

</div>

**Tell us what’s happening:**  
I am currently having a difficult time creating a div type selector with a width of 300px. I am not sure why it is not accepting my code.

```
  **Your code so far**

```

```html
/* file: index.html */
<!DOCTYPE html>
<html>
<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" type="text/css" />
</head>
<body>
  <div>
    <header>
      <h1>CAMPER CAFE</h1>
      <p>Est. 2020</p>
    </header>
    <main>
      <section>
        <h2>Coffee</h2>
      </section>
    </main>
  </div>
</body>
<html>

```

```css
/* file: styles.css */
body {
background-color: burlywood;
}

h1, h2, p {
text-align: center;
}
<div class="px_length">Width measured in px</div>
.px_length {
width: 300px;
}

```

```
  **Your browser information:**

```

User Agent is: `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36`

**Challenge:** Step 22

**Link to the challenge:**

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/2022/responsive-web-design/learn-basic-css-by-building-a-cafe-menu/step-22)**
>
> Learn to Code — For Free

---

<div class="post-metadata">

**Author:** ![diosa](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/diosa/32/265370_2.png) [@diosa](https://forum.freecodecamp.org/u/diosa)\
**Post date:** [June 15, 2022, 1:36pm UTC](https://forum.freecodecamp.org/t/step-22-in-styles-css/518350/3 "2022-06-15T13:36:40Z")

</div>

It still won’t accept.

---

<div class="post-metadata">

**Author:** ![Kaira](https://avatars.discourse-cdn.com/v4/letter/k/43a26b/32.png) [@Kaira](https://forum.freecodecamp.org/u/Kaira)\
**Post date:** [June 15, 2022, 1:45pm UTC](https://forum.freecodecamp.org/t/step-22-in-styles-css/518350/5 "2022-06-15T13:45:25Z")

</div>

> [@diosa](#):
>
> ```auto
> body {
> background-color: burlywood;
> }
> 
> h1, h2, p {
> text-align: center;
> }
> <div class="px_length">Width measured in px</div>
> .px_length {
> width: 300px;
> }
> 
> ```

@diosa first delete your div tag from css file,then give class attribute to alredy created div tag in the index.html file with the value px\_length. Then in the css file make changes as directed in .px\_length.

---

<div class="post-metadata">

**Author:** ![diosa](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/diosa/32/265370_2.png) [@diosa](https://forum.freecodecamp.org/u/diosa)\
**Post date:** [June 16, 2022, 10:13pm UTC](https://forum.freecodecamp.org/t/step-22-in-styles-css/518350/6 "2022-06-16T22:13:49Z")

</div>

Thank you for the help!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [December 16, 2022, 10:14am UTC](https://forum.freecodecamp.org/t/step-22-in-styles-css/518350/7 "2022-12-16T10:14:08Z")

</div>

Closed on December 16, 2022, 10:14am UTC

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