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

running this code below and i can't figure out why it's wrong <style> h1{ color:red } </style>

I think i followed the instructions for the code correctly.

index.html
<style>
  h1{
    color:red
  }

</style> 
<body>
    <h1>Nick Pettit</h1>
</body>
Jason S
Jason S
16,247 Points

put styles inside the body

Robert McCormick
Robert McCormick
4,400 Points

You are missing the semicolon at the end of your declaration. Also, I'm not sure if it will affect the functionality, but adding a space between your selector and the opening curly bracket is considered best practice. Try this and see if it works:

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

2 Answers

Grace Kelly
Grace Kelly
33,990 Points

Hi Alexander, you forgot the semi colan at the end of your statement, try:

 h1{
    color:red;
  }

The code works correctly but try placing your style tags within the <head> tags or <body> tags.