# Style an Element

**URL:** <https://forum.freecodecamp.org/t/style-an-element/178386>\
**Category:** General\
**Created:** [March 7, 2018, 5:48am UTC](https://forum.freecodecamp.org/t/style-an-element/178386 "2018-03-07T05:48:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johnsleye](https://avatars.discourse-cdn.com/v4/letter/j/a8b319/32.png) [@Johnsleye](https://forum.freecodecamp.org/u/Johnsleye)\
**Post date:** [March 7, 2018, 5:48am UTC](https://forum.freecodecamp.org/t/style-an-element/178386/1 "2018-03-07T05:48:36Z")

</div>

\*\*Tell us what’s happening:\*\*my code is below it refuses to run. kindly look at it and let me know what im doing wrong. Thanks

**Your code so far**

```auto
<style>
   .red text {color: red;}
</style>

<h2 class='red-text'>CatPhotoApp</h2>

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>

```

**Your browser information:**

Your Browser User Agent is: `Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36`.

**Link to the challenge:**  
[https://www.freecodecamp.org/challenges/use-a-css-class-to-style-an-element](https://www.freecodecamp.org/challenges/use-a-css-class-to-style-an-element)

---

<div class="post-metadata">

**Author:** ![thisiswhale](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/thisiswhale/32/76832_2.png) [@thisiswhale](https://forum.freecodecamp.org/u/thisiswhale)\
**Post date:** [March 7, 2018, 6:33am UTC](https://forum.freecodecamp.org/t/style-an-element/178386/2 "2018-03-07T06:33:40Z")

</div>

Your selector is missing a hyphen. That should work. 🙂

---

<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 17, 2021, 8:25pm UTC](https://forum.freecodecamp.org/t/style-an-element/178386/3 "2021-01-17T20:25:06Z")

</div>

Closed on January 17, 2021, 8:25pm UTC


