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

Roni Lubwama
Roni Lubwama
3,456 Points

How do i change the color of the h1 tag to purple?

Hi there, needed the code changing the h1 tag to purple.

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

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

  </body>
</html>
styles.css

8 Answers

Hey Roni,

You can change the color of the H1 with the color property.

h1 {
    color: purple;
}

You might want to re-watch some earlier videos or check out the Mozilla Developer Network.

why would treehouse set up a task challenge that you didn't cover? thats not fair... it took me a while to figure out also...why such a hassle?

Ellis Walker
Ellis Walker
3,325 Points

Same here! After reading this...I'm thinking, "That's what I'm supposed to do....that's easy." No explanation. I thought we were to edit the html file, not the css file.

John Park
John Park
1,449 Points

Even in the earlier videos, I don't recall them going over this specifically and I think that's what threw me off about this challenge. I understand that CSS is used to format the HTML, but how to type in the color property on CSS section wasn't mentioned, so thanks!

John Park: Treasure didn't explain how to do this, so you're not alone. She just gave an example without explaining what she was doing.

Emmanuel Deng
Emmanuel Deng
1,484 Points

Treasure didn't explain it at all. Is there anyone at Tree-house who can answer this question?

I just experienced the same issue. No explanation.

this is good website but why didnt they explain us this before the challenge ?

Vijayalakhsmi Yeddula
seal-mask
.a{fill-rule:evenodd;}techdegree
Vijayalakhsmi Yeddula
Front End Web Development Techdegree Student 395 Points

Tech degree videos are with inappropriate explanations. I like the one with $49/month plan. It was from basics. Basics are not covered here. I am dissappointed.

Jude Hotbrass
Jude Hotbrass
55 Points

very easy <hi style="color: purple"> my home<h1>

thank you