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

CSS How to Make a Website Beginning HTML and CSS Write a CSS Selector and Property

i dont understand this task "Now, write CSS that will select the h1. Don’t forget your curly braces!

what is required of me here

index.html
<body>
    <style>
        color: red;
  </style>
    <h1>Nick Pettit</h1>
</body>

2 Answers

All style elements should be outside of the body and, ideally, in the head of the document.

The style element contains stylesheet code. So any css would be written within it. What it's asking you to do is write CSS code that selects the h1 tag and to not forget that all CSS selectors are followed by curly brackets. The curly brackets are what contain the rules for that specific selector.

Example:

/* CSS class selector */
.greenClass {
    color: green;
}

/* CSS id seletor */
#uniqueElement {
    font-weight: bold;
}

/* CSS element selector */
h1 {
    color: red;
}

Thank got it

Caleb Senechal
Caleb Senechal
1,101 Points

Put your h1 inside of your style and then put your color within the h1