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
.
And style should work in all mainstream browsers with valid css.
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
.
And style should work in all mainstream browsers with valid css.
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.
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.