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

No CSS codes in the "change the color of the h1 tag to purple"

There's no CSS codes in the worksheet of this question, but in the videos, the way it showed us to change the code was in the CSS section. Pretty frustrating

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

3 Answers

Simon Coates
Simon Coates
28,694 Points
<!doctype html>
<html>
  <head>
    <link href="styles.css" rel="stylesheet">
  </head>
  <body>
    <h1>Welcome to My Web Page!</h1>   
  </body>
</html>

the styles.css should be:

h1 {
  color: purple;
}

Or is the problem just an observation that they haven't explained external stylesheets yet? (it's been a while since i did that course, i don't really remember if they did external or not)

Humberto Sifuentes
Humberto Sifuentes
7,694 Points

You can always add style from within the HTML file with:

<style type="text/css">
h1 { color: purple;
} </style>

Thanks guys! It was pretty much that the video only explains how to change an existing CSS stylesheet, rather than how to create a standalone instruction. I was trying to create a tag in HTML and then add the colour command in CSS under that tag name cause that's about as much detail as the video goes into