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

Alicia Williams
Alicia Williams
167 Points

I'm confused with the curly brackets

I need the CSS that will select the H1.

index.html
<h1>

<style>
  {background color: red}

  </style>

Alicia Williams</h1>

4 Answers

<style>
  h1 {

  }
</style>

<h1>Nick Pettit</h1>

You didn't select the h1, and the code challenge didn't ask for properties to be put in just yet :smile:

Also note that the style element should be outside all other HTML tags except the body and head tags.

I hope this helps. ~Alex

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there, Alicia! You're doing just fine! First, your <style> element is supposed to be added above the h1 element, not inside it. Also, you've not selected an element, but you're supposed to select the h1 and you've attempted to add a background color where the challenge hasn't asked for it.

To select an element inside a <style> element just type the name of the element and an open and closed curly brace. I will show you here how to select a paragraph element and hopefully you'll be able to see how to select an h1 element.

<style>
    p {
    }
</style>

I have now selected a paragraph element and any rules that will be applied to that paragraph will be written between the open and closed curly braces.

Hope this helps, but let me know if you're still stuck! :sparkles:

Oops... Answered at the same time :)

Alicia Williams
Alicia Williams
167 Points

thank you so much Jennifer and Alex! I appreciate the guidance.

Can you give either of us (Jennifer or I) a Best Answer so that this question is marked as Answered in the Community? Thanks and no problem :)

Alicia Williams
Alicia Williams
167 Points

I tried to give it to both of you. But, it wouldn't allow me too :( Sorry.

Yeah... sadly Treehouse only lets 1 best answer per question... Sometimes I wish I could give multiple Best answers as well :)