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 How to Make a Website Beginning HTML and CSS Write a CSS Selector and Property

Raashid A
Raashid A
805 Points

how do you select include whats written within h1 tags using the style tags ?

I've previously done a little bit of learning html on codecademy, so i am not a complete beginner. i'm on challenge Task 2 of 3, Its been a while since i last started the course so i cannot remember much especially in regards to CSS.

Anyways I am required to utilize curly brackets to help my style tags deal with the h1 tags . So far my code is written out as

<style> </style> <h1> Name </h1>

Since i cannot remember what was previously shown to me nor do i know how to watch a previous lesson, i do not want to start guessing and inputting various combinations to get my code to work as I've already attempted that twice and i won't understand anything from that. IT would help if someone could explain to me why something happens rather than me do trial an error to get my answers correct.

index.html
<style> </style>
{<h1>Nick Pettit</h1>}

2 Answers

Alexander Shibaylo
Alexander Shibaylo
8,887 Points

In CSS when you want to select an element you have to put it inside the style. You type the element, in your case it's h1, without the arrows

h1 {

}

Steven Ang
Steven Ang
41,751 Points

If you can't seem to remember how to do these tasks, how about you go back to stage 1 and rewatch them again? It certainly helped me when I returned back doing the web developing. In addition, Nick's explanation is very clear and cover the basics so you will know everything back you proceed to more advanced topics. The code snippet below is what you need to do, but again, to get a better grasp on the topic, go back to rewatch them since they gave you examples of what to do.

<style>
  h1 {
    /* Your styles go here 
       Example: color: red; */
  }
</style>
Raashid A
Raashid A
805 Points

I tried that it worked, took me awhile to figure out how to go back :)