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

HTML Introduction to HTML and CSS (2016) Getting Familiar with HTML and CSS Test: Changing the Look of a Web Page

Nagendra Prasad
Nagendra Prasad
183 Points

Change the color of the h1 tag to purple.

Change the color of the h1 tag to purple.

index.html
<!doctype html>
<html>
  <head>
    <link href="styles.css" rel="stylesheet">
  </head>
  <body>

    <h1 class="h1clolor">Welcome to My Web Page!</h1>

  </body>
</html>
styles.css
.h1color
{
  background-color:purple;  
}

2 Answers

Alejandro Byrne
Alejandro Byrne
2,562 Points

Hey! Your code seems to be right... try to add a space between the : and purple. And make it look like this: .h1color { background-color: purple; } If that doesn't work, replace purple with #800080. Hope that helps!

Alejandro Byrne
Alejandro Byrne
2,562 Points

And by the way, you don't need to make the h1 a class. Just take away the class and replace the css style with h1.

Looks like a typo to me.

In your h1 element, where you declare the class, you have it named as "h1clolor", but your css is targeting "h1color".