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

How do you change the color of the h1 tag to purple without quotes ?

how do you change the color of the h1 tag to purple without quotes ?

index.html
<!doctype html>
<html>
  <head>
    <link href="styles.css" rel="stylesheet">
      h1{color:purple;}
  </head>
  <body>

    <h1>Welcome to My Web Page!</h1>

  </body>
</html>
styles.css

4 Answers

Steven Parker
Steven Parker
231,269 Points

It looks like you put your CSS in the wrong file.

Your CSS line looks good, but instead of placing it in the index.html file, it should go in styles.css. Select that file using the tab that displays the file name, then add your CSS code there instead.

iuliana sagaidak
iuliana sagaidak
4,797 Points

first error is in link href="css/stylesheet.css"> - if it's in folder, you need to add css/ first. Then dont forget extencion .css

second error is h1{color:purple;} move it out from html to you css page. And dont forget a spase after element: h1 { color: purple; }

if you lost space, it can not work.

Steven Parker
Steven Parker
231,269 Points

Actually spaces between the selector and brace are optional. It works the same with or without them.

iuliana sagaidak
iuliana sagaidak
4,797 Points

I cheked the challenge. Here's what you need to do. You have this line <p>Welcome to My Web Page!</p> now, change it to this one (change p tag)

<h1>Welcome to My Web Page!</h1> I passed (Well done message appers)

Steven Parker
Steven Parker
231,269 Points

That's task 1 .. but Josiah is clearly on task 2.

Thank so much for your assitance, especially Steven Parker i appreciate your help, thanks again.