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 CSS Foundations Advanced Selectors Additional Pseudo-Classes

Fedor Andreev
Fedor Andreev
6,438 Points

Create a new rule using the selector that targets an element only if its ID matches the hash in a URL?

Set the background color to tomato.

Here is my code

:target{ background-color: tomato; }

I attempted every possible code that the video taught me. My conclusion is this following code I mentioned, however something needs to be written inside these { } and the question will be answered. If that's not the case, then I am totally lost. Help, give me a hint.

Only if it's ID matches the hash in the URL? The has in the url can be seen by looking at the URL but there is no URL on the index.html page!

2 Answers

you are right using :target { } rule what does it say .... By the url it means that when you click on one element and it takes you to the specified section

Hi Fedor,

I copied and pasted your code into the code challenge and it passed. It's not your fault.