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

Now, write CSS that will select the h1. Don’t forget your curly braces!

Now, write CSS that will select the h1. Don’t forget your curly braces!

index.html
<style>

  {h1}


</style>
<h1>Nick Pettit</h1>

2 Answers

If there is a CSS file, it would be at the top of the black box that you are entering your code into. Usually, you will see a tab for the .html files, and then a tab for the .css files (I can't remember what they individually call each tab/file as that can change).

Remember how to select elements for CSS. The syntax (rules of how the code is worded and ordered) calls for the element (or ID, class, etc.) that you want to style, followed by the opening and closing curly braces. The typical standard is to put the element, a space , the open curly brace (all on the first line). Then the styling code that you want to apply on on the lines following, followed by the closing curly brace by itself on the bottom line. The styling should consist of a property and value pair on one line, seperated by a colon and ending with a semi colon to show that being the end of the line.

/*  THE FOLLOWING CODE WOULD APPLY TO ALL H1 ELEMENTS ON A PAGE */

h1 {
  property: value;
  another-property: value;
}