Use a CSS Class to Style an Element, my h2 doesn't change to red

Tell us what’s happening:

Your code so far

 <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 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/ Safari/537.36.

Link to the challenge:

a few things wrong here.
First, your putting HTML content inside of your style tag. Consider the style tag as a pocket of CSS content.
The challenge wants you to add the .red-text class to the h2 tag.

That would look something like this.

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

Note that the class part is inside of the opening h2 tag. <h2 class="red-text"></h2>
So instead of adding anything to the stylesheet, were just adding class="red-text" to the opening tag of the h2.

This leaves us to the styling part. Here we select the h2 tag that has a class of red-text and give it text color of red.
It would look more like this.

<style> {
        color: red;

The .red-text part says that we are looking for an h2 tag with a class of .red-text. The period before red text is what tells our browser that red-text is a class.

If you need help grasping this, I would check out this site for basic css syntax.
Just stick with freecodecamp for the bulk of it.

Once you look at it for long enough it’ll click :slight_smile:

thank you for the response but i still don’t understand this… do i have to add { color: red; }

to it

Yes, you have the style section correct, but also the following would work:

.red-text {
 color: red;

The problem with your code is you closed your h2 element (put an extra >) where it does not need to be.