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 Test: Changing the Look of a Web Page

Siddharth Gupta
Siddharth Gupta
111 Points

how to change color of headings ??

question is <h1>welcome to my web page <\h1> i want to change color fro this headings

index.html
<!doctype html>
<html>
  <head>
    <link href="styles.css" rel="stylesheet">
  </head>
  <body>

    <h1>Welcome to My Web Page!</h1>


  </body>
</html>
styles.css

Hai siddharth, this is the code

h1 { color: blue; }

You can use which color you want to apply. Happy coding.

2 Answers

Oleg Kuperman
Oleg Kuperman
2,188 Points

You don't really change the color of the heading, since there isn't anything in your heading. You could, if you had an object. But if you are trying to change the color of the h1 tag (<h1>Welcome to My Web Page!</h1>)

That would be done, by adding this into your styles.css sheet

h1 { color: red; }

unless there is something else that you were looking for. :)

Gustavo Winter
PLUS
Gustavo Winter
Courses Plus Student 27,382 Points

Hi, you cant change the heading color, you only can change the colors of elements. <h1> / <h2>/ <h3> .... <section> / <div>.....

You will need to open a css code to make this change.

Search for this course : "how-to-make-a-website". There you will see how this change is made.