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 do I change the h1 tag to purple

I am having difficulty trying to figure out on one of the 2nd tasks of the html of having to change over the property of color purple from an h1 tag.

2 Answers

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,253 Points

Hi Sharon,

I don't have much to go on in terms of code but you're probably want something simple like this

h1 {
   color: purple;
}

which targets very h1 on the document and changes the colour to purple.

But maybe your document has a particular h1 element it wants you to target which you could accomplish by targeting a h1 eleent with a particular id.

h1#purple {
   color: purple;
}

In your CSS file, you select the element and set the style.

h1 {
     color: purple;
}