16
loading...
This website collects cookies to deliver better user experience
overflow: auto
. Alas, the situation around keyboard accessibility of these containers is patchy, and I only completly realized this after a current customer project which had an overflowing container. So, what follows is my little research on the topic and the current state of overflow scrolling afairs (see original sources at the bottom of the article)..my-overflowing-div:focus
to make its state more clear to friends of the Mozilla. However, the situation in Chrome, Chrome-based Edge and Safari is different. Without any changes in the HTML, overflowing content is not scrollable with the keyboard (unless, of course, there is an interactive element inside the container - but this scrolling doesn't uncover every part of the container).All interactive should be focusable
(Using WAI-ARIA)
tabindex="0"
to the overflowing container to make it baseline keyboard accessible..my-owerflowing-div:focus { outline: 2px solid; }
(if you want to be both future-proof when it comes to WCAG and an overall good web author citizen, take care of focus style contrasts).<div>
to a landmark region by both applying role="region"
and supplying an accessible name, by using aria-label
, for example. By doing so, you provide much-needed context to screen reader users - because they suddenly discover a focussable element that is not interactive in the classic sense (like a link or button would be).16