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 trialScott Strubberg
3,244 Pointshaving a hard time setting my text to purple in the 2nd task on first challenge.
halp!
<!doctype html>
<html>
<head>
<link href="styles.css" rel="stylesheet">
</head>
<body>
<p class="h1"></p>
<h1>Welcome to My Web Page!</h1>
</body>
</html>
.h1 {
color: purple;
}
1 Answer
Steven Parker
231,269 PointsWhen selecting by tag name, don't put a dot (period) before the name.
The dot is for selecting by class name. So as it is now, your CSS rule only targets the empty paragraph instead of the h1
element.
Also, I don't think adding another paragraph is part of the challenge.
Paul Franco
28,480 PointsPaul Franco
28,480 PointsIn the first task you changed the paragraph <p> to an <h1>. But now you are giving the Paragraph a class of h1 which is un-necessary since there is no text in the Paragraph. When you select the h1 in the CSS you don't need to select a class. You can just select the h1 element like so:
h1 { color: purple; }