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 CSS Foundations Text, Fonts, and Lists Text Properties

Jordan Hammond
Jordan Hammond
2,278 Points

Transform the h1 so that the first letter of each word is capitalized.

Why isn't this code working?

h1::first-letter {
  text-transform: uppercase;
}

or this

h1::first-letter {
  text-transform: capitalize;
}

Uggghhh

The property capitalize does what you want, you don't need to add the pseudo-element ::first-letter.

Something like this should work :

h1 {
   text-transform: capitalize;
}

2 Answers

Commented instead of answer, sorry my first message it was :)

Besides, the pseudo element ::first-letter doesn't concern the first letter of each word but only the first one.

Kate Hoferkamp
Kate Hoferkamp
5,205 Points

Antoine is super correct! You don't have to use any pseudo classes to complete the first step in the code challenge. It was just looking for a text-transform on the h1 to capitalize.