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 Introduction to HTML and CSS (2016) Getting Familiar with HTML and CSS Test: Changing the Look of a Web Page

Daniel Brown
Daniel Brown
240 Points

Basic HTML CSS helpChange color of h1 tag to purple.

hi friends! I need help with changing the color of a text in h1.

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

be sure to watch your syntax, your closing h1 should look like this: </h1>

***also, there are many ways to do this depending on what you are hoping to accomplish. The easiest way would make a CSS rule for the h1 selector.

h1 { color: purple; }

***this way will make all of your h1's purple, so you may want to give the specific h1 header you are looking to manipulate an ID and write a new rule for it.

html (line 8):

<h1 ID="purple-title">Welcome to My Web Page!<h1>

CSS:

purple-tilte {

color: purple; }

***for a basic layout like this one it really wont matter, but the more specific you are, the easier it will be to change later.

It's extremely important to see what your answer is, as we can use this as a bench mark to guide you to the correct answer. Before I can help I need to see what you have come up with, even if it's totally wrong, it doesn't matter. By seeing your answer we can see your thought process, and that is more important than syntax. We want to help, but we need to see what you come up with as well.

2 Answers

Kieran Corcoran
Kieran Corcoran
11,188 Points

You will need to target the h1 from your style sheet.

h1 { color: red; }