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

Code not working and highlighting red

Here's my CSS code... why is it highlighting red?? And when I preview it, the code highlighted red isn't working. could somebody please help me?? >.<

It's highlighting the body, header, border colour, nav, h1 and h2 :/

Code:

  /* site body */
body {
 background-color: #fff;
  color: #999;
}

/* green header */
header {
  background: #6ab47b;
  border-colour: #599a68;
}

  /* nav background mobile devices */
nav {
  background: #599a68;
  }

h1, h2 {
  color: #fff;
}

1 Answer

When you use element selectors such as body, p, h1, etc. Sublime Text will highlight them red to mark them as selectors. You could try using a different selector. Other than that, it looks like you used the British version of color but the rest should work. If you still need help try posting the HTML so we can troubleshoot it.

/* site body */ 
body { background-color: #fff; color: #999; }

/* green header */ 
header { background: #6ab47b; border-color: #599a68; }

/* nav background mobile devices */ 
nav { background: #599a68; }

h1, h2 { color: #fff; }

no it's actually creating a big red box around the text... maybe it's marking it like that because it's wrong or something?? :/

i'm not sure I can get a picture...!!

Where are you posting the code that you are getting a red box? Is it one of the questions on the site or with your own html?

It's in my own workspace

edit: Aah I found it. When my cat was playing with my keyboard she messed some stuff up, and I thought I fixed it all... but I forgot one of these > on the end of one of my lines of code, so it was making everything else after it not work. Thanks anyway :)