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 to change the color h1 tag to purple

how to change the color h1 tag to purple

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

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

  </body>
</html>
styles.css
h1 {
  color: blue;
}
Cynthia Norwood
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Cynthia Norwood
Front End Web Development Techdegree Graduate 15,214 Points

h1 { color: purple; } And the link to an external stylesheet goes like this I believe. <link rel="stylesheet" type="text/css" href="mystyle.css"> I believe that will work.

2 Answers

Hi Lok.

This one is a fairly simple change to the style.css file.

CSS, or Cascading Stylesheets, is a file format used to stylize your HTML markup. In this case, it's just a matter of changing the "color: blue;" attribute to read "color: purple;"

I hope this helps!

I missed the change to the <link> element; Cynthia was right, it should be <link rel="stylesheet" type="text/css" href="styles.css">

Remove purple word in link tag from HTML file and write following code in style.css h1 { color: purple; }