Home >Web Front-end >CSS Tutorial >How Can I Make Scrollbars Work on iOS Devices with CSS Overflow?
When developing for the iPad, utilizing the CSS overflow property to activate scrollbars has proven futile. Despite employing both "overflow: auto" and "overflow: scroll," the device persistently conceals them, rendering scrolling an uncomfortable two-finger ordeal.
A Workaround that Gives Control Back to the User
iOS devices have a built-in quirk that prevents the standard scrollbar. To overcome this limitation, consider modifying the overflow property to "-webkit-overflow-scrolling: touch." This change empowers iOS devices with scrollbars that seamlessly blend with the device's native scrolling behavior.
Consider Revisiting Overflow
Another approach is to reconsider the need for overflow in your design. The limited screen real estate on iOS devices demands a thoughtful approach to content display. Explore adjusting your DIV dimensions or content organization to avoid overflow. Alternatively, you can use @media queries to conditionally hide overflowing content on smaller screens.
The above is the detailed content of How Can I Make Scrollbars Work on iOS Devices with CSS Overflow?. For more information, please follow other related articles on the PHP Chinese website!