views:

36

answers:

2

How to give different style, color to dotted border of keyboard navigation? Style should appear only if user use keyboard to navigate not on mouse over and :active.

alt text

And style should work in all mainstream browsers with valid css.

+5  A: 

That is not possible with CSS. Besides, it is not really desirable for usability reasons. Always keep Jakob Nielsen's "Law of the Web User Experience" in mind:

Users spend most of their time on other websites.

This means that they form their expectations for your site based on what's commonly done on most other sites. If you deviate, your site will be harder to use and users will leave.

RegDwight
+1 A nice quote to include.
Colin
Ditto for the quote too
o.k.w
+1 I would go with Jakob Nielsen's "Law. thanks for quote.this is not the answer for exact question but ur answer has valid reason and it should follow by every developer so I'm choosing this as a answer.
metal-gear-solid
+1  A: 

There's no natural or straightforward way to achieve that. Still, aside from usability reasons, it is possible to do it - just very troublesome to implement and maintain. It would be a combination of onKeyPress and onFocus handlers to set and remove styles based on a special map data structure that maps the directionality of whatever controls or form inputs you use on the page.

aberrant80