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 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 91,253 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 :)