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 triallaurenpradella
159 PointsHelp!
I keep putting {color:green} but it is not working and I don't know what else to put
laurenpradella
159 Points<body> <style> {color: green} <h1>Nick Pettit</h1> </body>
laurenpradella
159 Points<body> <style> h1 { color: green; } <h1>Nick Pettit</h1> </body>
It still won't work :(
7 Answers
Tunde Adegoroye
20,597 Pointsyour code should look like this
<style>
h1 {
color: green;
}
</style>
<h1>Nick Pettit</h1>
</body>```
I think your missing the style tag or misplacing it
laurenpradella
159 PointsIt worked!!! Thank you so much :) :)
Tunde Adegoroye
20,597 PointsHahaha finally got there :)
Kevin Naegele
10,868 PointsAre you putting a selector in front of your code? When you are writing your CSS you have to tell it what it is affecting ie: h1,h1,p,a... ex
here is an example
h1{ color:green; }
Tunde Adegoroye
20,597 PointsYou have to add the style sheet then write the element aka the selector and then the property with a semi colon like so <style> h1 { color:green; } </style>
This should be within the body tag
laurenpradella
159 PointsThanks so much!!!
Tunde Adegoroye
20,597 PointsNo problem :)
Kevin Naegele
10,868 Pointscan you copy the question?
laurenpradella
159 PointsFinally, set the color of the h1 element to green.
laurenpradella
159 Pointsand this is what I've got!
<body> <style> h1 { color:green; } <h1>Nick Pettit</h1> </body>
Kevin Naegele
10,868 Pointsthat looks correct. try removing the space between h1 and the {. but that is correct.
laurenpradella
159 PointsIt keeps saying I'm wrong!!! :(
Tunde Adegoroye
20,597 PointsIs it in a style tag in the body ?
Stone Preston
42,016 PointsStone Preston
42,016 Pointscan you post your full code. you may be using an incorrect selector