# CSS Element and Class Issues

**URL:** <https://forum.freecodecamp.org/t/css-element-and-class-issues/162387>\
**Category:** General\
**Created:** [December 5, 2017, 6:50pm UTC](https://forum.freecodecamp.org/t/css-element-and-class-issues/162387 "2017-12-05T18:50:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aroth2020](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@aroth2020](https://forum.freecodecamp.org/u/aroth2020)\
**Post date:** [December 5, 2017, 6:50pm UTC](https://forum.freecodecamp.org/t/css-element-and-class-issues/162387/1 "2017-12-05T18:50:24Z")

</div>

**Tell us what’s happening:**  
Im not quite sure what I need to do here. The instructions say my stylesheet should declare a “.red-text” class and set its color to red. Any help would be appreciated

**Your code so far**

```auto
<style>
  h2 {
    color: red;
  }
</style>
<h2 class="red-text">CatPhotoApp</h2>
<h2>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 (X11; CrOS x86_64 9901.77.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.97 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:** ![aroth2020](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@aroth2020](https://forum.freecodecamp.org/u/aroth2020)\
**Post date:** [December 5, 2017, 7:52pm UTC](https://forum.freecodecamp.org/t/css-element-and-class-issues/162387/3 "2017-12-05T19:52:45Z")

</div>

If I need to have a class declaring “red-text”, where do I type this? I have tried entering things like .red-text class=“red-text”\>CatPhotoApp

## . Do I need to do this differently or what am I messing up? Your help is highly appreciated.

---

<div class="post-metadata">

**Author:** ![aroth2020](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@aroth2020](https://forum.freecodecamp.org/u/aroth2020)\
**Post date:** [December 5, 2017, 7:59pm UTC](https://forum.freecodecamp.org/t/css-element-and-class-issues/162387/4 "2017-12-05T19:59:31Z")

</div>

I checked out another person with this same problem and tried their code with one addition and it seemed to work. I do have a question about why one piece of code is needed then.

```auto
 h2 {
    color: red
  }
If that code is already written, why is this code here applicable?
  h2 .red-text {
    color: red;
  }

```

Thanks for the support. Ill try and come back here if I have any more questions.

---

<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:32pm UTC](https://forum.freecodecamp.org/t/css-element-and-class-issues/162387/6 "2021-01-17T20:32:59Z")

</div>

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


