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 trialAlicia Williams
167 PointsI'm confused with the curly brackets
I need the CSS that will select the H1.
<h1>
<style>
{background color: red}
</style>
Alicia Williams</h1>
4 Answers
Alexander Davison
65,469 Points<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
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
Treehouse TeacherHi 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!
Alexander Davison
65,469 PointsOops... Answered at the same time :)
Alicia Williams
167 Pointsthank you so much Jennifer and Alex! I appreciate the guidance.
Alexander Davison
65,469 PointsCan 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
167 PointsI tried to give it to both of you. But, it wouldn't allow me too :( Sorry.
Alexander Davison
65,469 PointsYeah... sadly Treehouse only lets 1 best answer per question... Sometimes I wish I could give multiple Best answers as well :)