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

Tamika Harris
Tamika Harris
167 Points

how to change h1 tag to the color purple in css

how to set the class in css to change the html h1 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
<h1> class=purple <h1>

1 Answer

Owa Aquino
Owa Aquino
19,277 Points

Hi Tamika,

This is how to set the CSS styles for the element:

  1. first you need to enter the element you wanted to be style.
  2. then you need open and closing curly braces.
  3. then inside the closing and open curly braces you'll enter your styles.

See sample below.

hi { 
  color: purple;
}

Hope this help. Owa