iOS Scrollbar Frustrations: Troubleshooting Overflow CSS
Developing for an iPad website, you stumbled upon an unexpected issue: CSS overflow properties (overflow: auto or scroll) fail to display scrollbars despite enabling two-finger scrolling. This quirk is exclusive to iOS devices.
Addressing the Issue:
Updated Fix (iOS 5beta and Onward):
As pointed out by kritzikratzi, a new property introduced in iOS 5beta (-webkit-overflow-scrolling: touch) can resolve this issue, triggering the expected scrolling behavior.
Original Remedy (iOS 5 and Below):
Unfortunately, neither overflow: auto nor scroll generates scrollbars on iOS devices due to the limited screen space. Instead, the two-finger swipe mechanism is the designated method for scrolling overflowing content.
Alternatives:
Example using @media queries:
<link rel="stylesheet" href="handheld.css" media="only screen and (max-device width:480px)" />
The above is the detailed content of Why Are Scrollbars Missing on My iPad Website in iOS?. For more information, please follow other related articles on the PHP Chinese website!