Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS CSS Selectors Advanced Selectors :root and :target

Spencer Renfro
PLUS
Spencer Renfro
Courses Plus Student 9,976 Points

The animation in the teachers note: the hash in the browser's URL does not change when clicking the eat button.

In the video explanation of the pseudo class :target, when the buttons are clicked for the different columns the url changes, however this is not the case in the animation link provided in the teachers notes. Why is that?

1 Answer

Steven Parker
Steven Parker
216,891 Points

That example uses codepen, which simulates the environment within a frame on the page. Your browser's URL always points to the codepen page, even when the contents of the frame change.

If you copy the code to a workspace and use that instead of codepen, you'll see the behavior you are expecting.