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 I change the color of text in HTML?

I tried using tagging attributes in the styles.css files but that didn't work. I also tried change it using curly brackets.

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

7 Answers

Robert Bennett
Robert Bennett
11,927 Points

Here is part one - to change the <p> tag to an <h1> - Part two - go to styles.css sheet and make a new CSS rule-set in the styles.css sheet.

<h1>Welcome to My Web Page!</h1> Go to styles.css and put new code in here => h1 {color: purple;}

<h1 style="color: white;">Welcome to My Web Page</h1>

or in the html <h1>Welcome to My Web Page</h1>

and in the css h1 { color: white; }

make sure the file structure is correct, if styles.css is in a css folder then you need to link using "css/styles.css" also make sure h1 isn't in the css as a class, there shouldn't be a . in front of it as that would indicate a class. Check your semi-colon's as well. Otherwise it should work.

Robert Bennett
Robert Bennett
11,927 Points

Chadwick Savage you have - h1 { color: white; }. The challenge says," Change the color of the h1 tag to purple ". Danielle Townsend , use this code for the challenge ," h1 {color: purple;} ". Don't use white for the color.

I kept putting "tag style = "color: purple" not realizing it was saying NO QUOTES! I was getting confused. and was getting confused. Both answers were super helpful Robert Bennett and Chadwick Savage. Thank you!

Robert Bennett
Robert Bennett
11,927 Points

We all start somewhere... Glad that it did!

Gotcha. I didn't know he was referencing a specific challenge.

Robert Bennett
Robert Bennett
11,927 Points

That;s OK - I have done it myself... At least you are trying to help.. I learrn faster on here helping and looking things up for people.. I hope you become a kick butt programmer!