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

CSS How to Make a Website Beginning HTML and CSS Write a CSS Selector and Property

I have no idea whats wrong

Help, whats wrong with this?

index.html
<style>
  h1 {
   color:blue; 
  }
</style>
<body>
    <h1>Nick Pettit</h1>
</body>

5 Answers

Ryan Field
PLUS
Ryan Field
Courses Plus Student 21,242 Points

You don't need to make multiple forum posts for the same question. Just add on to your last post. In any case, please pay attention to the challenge instructions. You have the wrong colour. :)

Edit: Like Samuel Webb says below, you also have the style tags in the wrong place.

<!DOCTYPE html>
<html>
<head> // open head , style need to be inside the <head></head> after the title.
<title></title>
<style>
  h1 {
   color:blue; 
  }
</style>
</head>  // close head

<body>
    <h1>Nick Pettit</h1>
</body>
</html>
Ryan Field
Ryan Field
Courses Plus Student 21,242 Points

While usually correct, this challenge is specifically asking you to put the style tags above the h1 inside the body.

did you try, instead of putting the

<style>

h1 {color: blue;}
</style>

put on the body tag like this:

<h1 style="color:blue;">Nick Pettit</h1>
Samuel Webb
Samuel Webb
25,370 Points

Also, the style tag needs to be contained in the body, similar to the h1.

Luciano Bruzzoni
Luciano Bruzzoni
15,518 Points

Hey there, the instructions say to add the style above the <h1> element, so it should be as follows

<body>
    <style>
          h1 {
                color: green; 
          }
    </style>

    <h1>Nick Pettit</h1>
</body>

that should do it!