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 trialMeenakshi Bohra
1,182 Pointshow to set the color of the h1 element to green
how to set the color of the h1 element to green
<body>
<style>
<h1> {
color : green ;
}
</style>
<h1> meenakshibohra </h1>
</body>
3 Answers
highlandcow
7,352 PointsYou select elements without <> when defining a CSS rule.
So instead of...
<h1> {
color : green ;
}
...you'd do...
h1 {
color : green ;
}
Matthew Rigdon
8,223 PointsYou want to modify the color of your text inside of the CSS file, not the HTML document. This is good practice. Inside the CSS document, you write:
h1 {
color: green;
}
This will set all <h1> tags to have a text color of green.
Christopher Carrasco
20,679 Points<style>
h1 { color: green; }
</style>
<body>
<h1>Text in here should be green</h1>
</body>
** style element should not be inside the body element, but rather before it. Also the '<>' surrounding the h1 shouldn't be used when styling the h1 element, but It IS needed inside the body element.** Hope this makes sense.