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 trialAdrian Pivetta
1,742 PointsNot 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
<!doctype html>
<html>
<head>
<link href="styles.css" rel="stylesheet">
</head>
<body>
<h1>Welcome to My Web Page!</h1>
</body>
</html>
2 Answers
jose macedo
6,041 Pointsif 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; }
Steven Parker
231,248 PointsIt'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
1,742 PointsSo 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?
jose macedo
6,041 Pointsjose macedo
6,041 Pointsand 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">