Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML Introduction to HTML and CSS Getting Familiar with HTML and CSS Building Web Pages with HTML and CSS

Sherman Hightower
Sherman Hightower
3,294 Points

How to change the <h1> color?????

The class dose not show you how to do it.

if you want change to blue

<h1 style="color:blue;">This is a Blue Heading</h1>

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! I posted an answer which I removed as it wasn't entirely accurate. They do show you how to add CSS for a h1 tag, but they show you using a class. If you want to change the color of an h1 tag without using a class, it would be done this way:

h1 {
  color:  green;
}

I hope this helps! :sparkles:

mohammed qadi
mohammed qadi
852 Points

im sorry but i really didnt know where to write that code if its writen in css it didnt work for me

Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi, mohammed qadi! If you mean for the challenge at the end of this series, you'll find two tabs in the challenge. One is index.html and the other is styles.css. Your code should go in the styles.css tab. :sparkles:

mohammed qadi
mohammed qadi
852 Points

ok thx i just messed up with some code i found online , i deleted it and it worked thx anyways and thx for the super quick response :)

Hi, changing colours is super easy.

<div class="my_container">
   <h1>Hello world!</h1>
</div>
.my_container h1{
   color: black; /* or hexidecimal */
}

There are alternatives to doing this.

You can assign a id or class to the h1 directly & call it in the stylesheet or you can do direct styles to the h1 tag

   <h1 style="color: #eee;">Hello world!</h1>
Carlos Martinez
Carlos Martinez
10,660 Points

You are missing a semi-colon after black.

Good eye, I am so used to text editors auto completing them :P