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

Aldrich Alviar
Aldrich Alviar
2,745 Points

how to change the color of the h1 tag to purple?

what is the steps in 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

2 Answers

Your stylesheet seems to be empty, but if it's linked correctly, you can just add

h1 {
  color: purple;
}
Aldrich Alviar
Aldrich Alviar
2,745 Points

how to set purple color property of h1 element (without quetes)?

Make sure that your css file is linked properly and add those lines in your css file, it will work. I don't know what you mean with quotes, because there's no quotes that code.

Jay Padzensky
Jay Padzensky
4,731 Points

You may also add some style elements which would permit you to change element properties in the HTML file.

<style>
    h1 {
    color: purple;
}
</style>