Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

How to turn the <h2> words to red </h2> using CSS code?

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


  <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>

(The above did not work?

//Fixed Code Presentation

5 Answers

Hello Sarah, You are missing the added class name to the h2 tag. Try this

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

I hope this helps.

They want it in CSS .red-text that sort of thing.

But I thank you for trying, Chyno!

I did this (which gave me what I wanted, except I still got back a message being 'Your h2 element should have the class red-text.')

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

h2 { color: red;}

</style>

<h2>CatPhotoApp</h2>

It's another case of crap instructions, Chyno. I figured it out. Thanks so much! This is what they wanted.

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

h2 { color: red;}

</style>

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

Glad you were able to figure it out. Just for future reference you can also write your style like this.

.red-text, h2 {color: red;}

Hope this helps =)