Main Contents

Do you pay attention to the :focus pseudo-class?

CSS, Code March 19, 2010

Quite probably you do use the :link and :visited pseudo-class, and also do some fancy styling on :hover and :active situations, but when was it that you’ve paid attention to the :focus?

What IS :focus you might wonder.

Focus comes into play when somebody uses the keyboard and not the mouse to navigate (by tabbing though) your site.

Implement it for example like this:

a:link, a:visited { color: brown; }
a:hover, a:focus, a:active { color: orange }

Very easy to add and it will make you site more accessible.

 

Leave a comment


Google Analytics Alternative