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

how to set the color the h1 element to green?

how to set the color the h1 element to green ?

index.html
<h1>shaggy</h1>shaggychipy<style>ccz<h1>(css)<h1>(css)<h1>{css}<h1>{css}<h1green>

1 Answer

Juan Guillermo Mariño
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Juan Guillermo Mariño
Front End Web Development Techdegree Graduate 19,423 Points

Hello Shadreck, look here is the solution: remember every time you open an html tag <> you must close it </> so the first step it says: We're starting out with an <h1> element. Add a <style> element just above the <h1>.

<style> </style>
<h1>shaggy</h1>

Later it says to select the h1 element in the style tag like as if it was a stylesheet Now, write CSS that will select the h1. Don’t forget your curly braces!

<style> h1 {} </style>
<h1>shaggy</h1>

And finally set the color to green... Nice! Finally, set the color of the h1 element to green.

<style> h1 { color: green; } </style>
<h1>shaggy</h1>

The "color" is a css property that will modify the color of text every time you give the value, in this case that will be "green" you must close it with ";" and every time you open and close the css rules with {} so the <style> tag is technically CSS written in the html code

SO YOUR FINAL ANSWER IS THIS:

<style> h1 { color: green; } </style>
<h1>shaggy</h1>

Have a great day!