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

how do i fix this error message

"Don't forget your style tag"i entered the correct codes and if i preview it everything

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

</style>
<h1>prosper poshayi</h1>

4 Answers

Sam Baines
Sam Baines
4,315 Points

Hi Prosper - you are missing a semi-colon after the word 'Green' so the css isn't closing properly.

Samuel Webb
Samuel Webb
25,370 Points

Just for future reference, a semicolon is only required when you want to add more than one modifier to an element selection. Example:

h1 {
  color: green;  /*semicolon required to move to next line*/
  display: block  /*semicolon not required since it's the last one in the curly braces */
}

It is however not required if you only have one modifier, or if it's the last modifier inside of the curly braces. To be clear, it's still good practice to always end your modifiers with a semicolon:

h1 {
  color: green;
  display: block; /*good practice but not required*/
}
Samuel Webb
Samuel Webb
25,370 Points

Did you erase the body tags? If so, they're required.

thanx Samuel for your response, where do i put the body tags?

Samuel Webb
Samuel Webb
25,370 Points

I'd suggest re-watching an HTML video before dealing with CSS if you're not sure where to place the body tags.

Thanx guys i won