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 Basics (2014) Basic Selectors Pseudo-Classes

focus won't work

focus won't work when i hit tab on my mac.

here my code... https://w.trhou.se/cl05mzmhf2

focus won't work for me either.

4 Answers

The :focus selector is allowed on elements that accept keyboard events or other user inputs.

input:focus { background-color: yellow; }

Well you need to focus on your work. HAHA

so how do i replicate what Guil did in the episode?

It's working for me. You click on the link? What browser you using? image: http://postimg.org/image/3p5qtvtc1/

Chris, you need to use the TAB button on your keyboard to jump to each link on the page. focus rules will then work.

So the Focus psedo-class works fine with Chrome. What would be the reason why it does not work with Safari? When I hit the tab key it selects some browser options up top including search bar.