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 set the color for an h1 element

h1 element

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




  </style>
    <h1>Nick Pettit</h1>



</body>

2 Answers

Emma Willmann
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Emma Willmann
Treehouse Project Reviewer

You're pretty close. You just need to move the h1 outside of the brackets, like this:

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

You can then set multiple different things like color and size within the brackets. You'll learn more about that as you keep going!

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 90,705 Points

Hi Jennifer. You're almost there! :)

      h1 {
      color: green;
    }

Your h1, which is the selector in CSS, actually goes before the curly brace.

Welcome to Treehouse :)