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

HTML How to Make a Website Beginning HTML and CSS Write a CSS Selector and Property

I forgot what to write for the Ccs

I'm just forgetful sometimes........what Wut I saying?

index.html
<style>

  {


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

2 Answers

Josh Keenan
Josh Keenan
20,315 Points

Hey Phoenix,

to select the h1 element we simply type h1 between the style tags and this will select it for manipulation.

<style>

  h1{}

</style>

<h1>Nick Pettit</h1>
Dane Parchment
MOD
Dane Parchment
Treehouse Moderator 11,077 Points

Alright let's break down the full challenge starting with step 1:

We're starting out with an <h1> element. Add a <style> element just above the <h1>.

<style>

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

That part you got right so no need to focus too much on that. However, on the next step we have to:

Now, write CSS that will select the h1. Don’t forget your curly braces!

Remember that CSS is written with this syntax

selector {
  property: value;
}

In our case we have to select an h1 and we don't have any properties to write so:

<style>
     h1 {
}
</style>
<h1>Nick Pettit</h1>

However, in the next step:

Nice! Finally, set the color of the h1 element to green.

We now have a property that we must edit, called color, and its value must be green so referring to the earlier code snippet, we must do this:

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

Hopefully this was helpful to you, but I do recommend going back and watching the previous videos until you get a better understanding of the syntax.