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

Set element color

Having trouble setting element of h1 in the coding challenge to the color green... any tips?

5 Answers

Ira Santiago
Ira Santiago
18,625 Points

Remember in order to change the style for the h1 element and see that change, it has to exist in your HTML. You have to wrap your name in the h1 element first or you won't see anything happen.

        <h1>This is a level 1 heading!</h1>

Once you do that, you can refer to it in your CSS to change the color, like this:

        h1 { color: red; }

Hope that helps!

Ira Santiago
Ira Santiago
18,625 Points

Hey Michael, what do you have so far?

<!DOCTYPE html> <html>
<style> <h1> Michael </h1> </html>

... that seems to run but can't figure out where to insert or impose "color:green" and make the code run... thx

Came out wrong there...so far:

<!DOCTYPE html> <html>

<style> <h1> Michael</h1>

</html>

James Barnett
James Barnett
39,199 Points

The forum uses markdown to correctly format code, check out this thread on how to type code in the forum for some examples.

Thanks~!