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

Peter Mitchell
Peter Mitchell
2,437 Points

When adding internal style header {....} for a background color, "header" is highlighted red, so its not rendering.

Have removed the inline style background before, have made no changes, but the treehouse workspace simply does not want to accept my header command in the <style></style> section. Please help!

Can you show us the code?

Rebecca Jensen
Rebecca Jensen
11,580 Points

Tip - to paste your code here:

hit return

enter 3 tick marks, they look like this: ` and it's in the upper left corner of your keyboard

paste in code

hit return

enter 3 tick marks again

like this!

1 Answer

Wilson Usman
Wilson Usman
35,206 Points

I just tested in workspaces this code and it's working fine.

Workspace Test

<!doctype html>
<html class="no-js" lang="">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="x-ua-compatible" content="ie=edge">
        <title></title>
      <style>
        header {
          background-color:red;
        }  
      </style>

    </head>
    <body>
      <header>
        <p>Hello Cat!</p>
      </header>
    </body>
</html>