Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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