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

I am not sure how to change the color of the h1 tag to purple. Please help.

Not sure about this

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

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

  </body>
</html>
styles.css
tag
  color: purple
Dmitriy Zheltkov
Dmitriy Zheltkov
1,527 Points

Seems like you're missing the curly brackets in your CSS:

.tag {
    color: purple;
}

3 Answers

Kevin Becerra
Kevin Becerra
14,243 Points

There's two things missing you need to add. The period before the 'tag' because it's a class and you also need to add the curly braces to assign it to the class tag. Sometimes its small errors that won't allow the changes you want to be done but don't let this discourage you. Keep at it and have fun coding!

    .tag{
        color: purple;
    }

thanks

Ezra Siton
Ezra Siton
12,644 Points
// Class selectors are defined with the . character followed by the class name.
.tag {
    color: purple;
}

https://teamtreehouse.com/library/css-basics/basic-selectors/class-selectors

Thanks, appreciate the help!