Reputation: 152647
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 http://easycaptures.com/fs/uploaded/234/9318036912.png
And style should work in all mainstream browsers with valid css.
Upvotes: 0
Views: 285
Reputation: 12997
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.
Upvotes: 1
Reputation: 25229
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.
Upvotes: 5