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

Adrian Pivetta
Adrian Pivetta
1,742 Points

Not sure how to turn H1 font to purple. Nothing in CSS and I do not know how to categorize H1 and make it appear in CSS

a

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

2 Answers

jose macedo
jose macedo
6,041 Points

if you have several h1's you should assign a class if you want to target a certain h1 but other than that you can just select the element by typing the element name

h1 { color: purple; }

jose macedo
jose macedo
6,041 Points

and you might have several css files so you should drop your css file into a css folder and change your link to href="css/style.css">

Steven Parker
Steven Parker
231,248 Points

It's up to you to write the CSS here. Start with a selector that targets your element. You can use h1 as the selector since that's the kind of element.

Then make a block with braces ({}), and inside that put the parameter you want to change and the value, separated by a colon. You may have figured by now but the parameter is color and the value you want to give it is purple.

Adrian Pivetta
Adrian Pivetta
1,742 Points

So should I make H1 into a class? Or should I be targeting H1 in css in which case after I put :target { what goes next?