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

Scott Strubberg
Scott Strubberg
3,244 Points

having a hard time setting my text to purple in the 2nd task on first challenge.

halp!

index.html
<!doctype html>
<html>
  <head>
    <link href="styles.css" rel="stylesheet">
  </head>
  <body>
    <p class="h1"></p> 
    <h1>Welcome to My Web Page!</h1>

  </body>
</html>
styles.css
.h1 {
  color: purple;
}

In the first task you changed the paragraph <p> to an <h1>. But now you are giving the Paragraph a class of h1 which is un-necessary since there is no text in the Paragraph. When you select the h1 in the CSS you don't need to select a class. You can just select the h1 element like so:

h1 { color: purple; }

1 Answer

Steven Parker
Steven Parker
229,744 Points

When selecting by tag name, don't put a dot (period) before the name.

The dot is for selecting by class name. So as it is now, your CSS rule only targets the empty paragraph instead of the h1 element.

Also, I don't think adding another paragraph is part of the challenge.