问题
I am having trouble getting a scroll bar to appear in mobile safari because overflow: auto does not work when there is scroll-able content. I found this css property:
-webkit-overflow-scrolling: touch
as some suggested this is a fix for mobile safari hiding the scroll bars but it's not working for me. Anyone have any suggestions on how I can force there to be a scroll bar in mobile safari to give the user a visual that they are supposed to scroll?
回答1:
In your CSS include:
::-webkit-scrollbar {
-webkit-appearance: none;
width: 7px;
height: 7px;
}
::-webkit-scrollbar-thumb {
border-radius: 4px;
background-color: rgba(0,0,0,.5);
-webkit-box-shadow: 0 0 1px rgba(255,255,255,.5);
}
Customize the appearance as needed.
Stackoverflow source
Original source
来源:https://stackoverflow.com/questions/14842876/how-to-force-a-scroll-bar-to-appear-in-the-ipad-mobile-safari