# Use a CSS Class to Style an Element Potential bug

**URL:** <https://forum.freecodecamp.org/t/use-a-css-class-to-style-an-element-potential-bug/166206>\
**Category:** General\
**Created:** [December 31, 2017, 8:57pm UTC](https://forum.freecodecamp.org/t/use-a-css-class-to-style-an-element-potential-bug/166206 "2017-12-31T20:57:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mukul571995](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/mukul571995/32/74920_2.png) [@mukul571995](https://forum.freecodecamp.org/u/mukul571995)\
**Post date:** [December 31, 2017, 8:57pm UTC](https://forum.freecodecamp.org/t/use-a-css-class-to-style-an-element-potential-bug/166206/1 "2017-12-31T20:57:43Z")

</div>

**Tell us what’s happening:**

**Your code so far**

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

<h2 style = "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.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36 OPR/49.0.2725.64`.

**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:** ![petersim](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/petersim/32/74464_2.png) [@petersim](https://forum.freecodecamp.org/u/petersim)\
**Post date:** [December 31, 2017, 9:20pm UTC](https://forum.freecodecamp.org/t/use-a-css-class-to-style-an-element-potential-bug/166206/2 "2017-12-31T21:20:08Z")

</div>

Try:

```auto
<h2 class="red-text">

```

---

<div class="post-metadata">

**Author:** ![mukul571995](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/mukul571995/32/74920_2.png) [@mukul571995](https://forum.freecodecamp.org/u/mukul571995)\
**Post date:** [January 4, 2018, 6:27am UTC](https://forum.freecodecamp.org/t/use-a-css-class-to-style-an-element-potential-bug/166206/3 "2018-01-04T06:27:54Z")

</div>

I used the same, problem is that when you sometimes edit the existing code, fcc does not recognised that, resulting in error. I just reseted the code, made changes and it was accepted.

Thank you for your quick response,  
Its very lively here

---

<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:31pm UTC](https://forum.freecodecamp.org/t/use-a-css-class-to-style-an-element-potential-bug/166206/4 "2021-01-17T20:31:38Z")

</div>


