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 trialChidiebere Ekeh
Courses Plus Student 959 Pointshow do i create h1 selector?
<!doctype html>
<html>
<head>
<link href="styles.css" rel="stylesheet">
</head>
<body>
<h1>Welcome to My Web Page!</h1>
</body>
</html>
color: purple
3 Answers
Tobias Erich
Courses Plus Student 2,980 PointsHey, you need to explain the browser WHAT he should do on WHICH element.
h1 {} /* This is the selector, which tells the browser the element you want to change. */
h1{
color: purple; /* This is a declaration. It tells the browser what he should do with your selector */
}
Now the code should work. And don't forget the ; after a declaration as you can see in my example.
Jennifer Nordell
Treehouse TeacherHi there! I've changed your comment to an answer
Tobias Erich
Courses Plus Student 2,980 PointsHey, Thank you :)
Lee Torson
8,694 PointsIn your CSS, you would do the following:
h1 {
color: purple;
}
Jennifer Nordell
Treehouse TeacherHi there! I've changed your comment to an answer
Todd Harvey
3,178 PointsThis helped
Gustavo Winter
Courses Plus Student 27,382 PointsI'm not sure about what are you asking, but your code is right to pass the challenge.
By the way, to create a h1 selector you need to open and close the tag like this:
<h1>This is code!</h1>
This tag has many levels, like:
<h1>This is code!</h1>
<h2>This is code level 2</h2>
<h3>This is code level 3</h3>
For more info, check the MDN- H1 Selector
Jennifer Nordell
Treehouse TeacherHi there! I've changed your comment to an answer
On a side note, the code and documentation that you've linked above are referencing the HTML element. You can take a look at the challenge linked at the top of the question. The selector is a term used in CSS to select the element. You can take a look at the MDN CSS Selector documentation. Thanks for helping out in the Community!
Chidiebere Ekeh
Courses Plus Student 959 PointsChidiebere Ekeh
Courses Plus Student 959 Pointsthanks guys