Reputation: 261
I am designing a single page website with some forms. It has 3 divs in it, 2 of them off the screen and i am using overflow:hidden
to hide them from users. But when tab key pressed browsers scrolls to the next div with a broken design.
So, is there a way to disable tab key?
Upvotes: 1
Views: 2092
Reputation: 324790
Moving elements off-screen is a terrible way of hiding them. display: none
and visibility: hidden
are there for a reason, and that reason is not "to be replaced with left: -9999px
.
Upvotes: 1
Reputation: 1473
Set property tabindex=-1
for an element and it will not be keyboard focusable.
Upvotes: 2