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

Harley Jean
Harley Jean
2,070 Points

The previous videos did not define what a selector was, how do I create it?

How do I create a selector?

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

Patrik Horváth
Patrik Horváth
11,110 Points

you should watch course again :)

#idname  - ID selector
.className - class selector
tag -  tag selector

........

there is more a lot of more but this are just basics

1 Answer

Brian Jensen
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree seal-36
Brian Jensen
Treehouse Staff

Hmmm you are right. The 3 preceding videos do not make it very clear what a selector is. The closest that it comes to explaining it is at the 2 minute mark in the 2nd video. In this example Treasure is using the "class selector" .location to change the text color from yellow to white.

What is needed for this challenge is to use the "type/element selector" which is to tell css to target the h1 element. Similar to how Treasure targeted the "class" .location. So simply h1 and a set of curly braces, then the style you want to change inside of the curly braces.

h1 {
  color: purple;
}

Here is a good article that explains it further: https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Simple_selectors#Type_selectors_aka_element_selectors

A situation where things are not fully explained like this is actually extremely rare in teamtreehouse content. So don't let this discourage you from learning. All of the concepts that are very briefly discussed in these introduction videos are explained in great detail in future videos.