웹프로그래밍/CSS
CSS overflow scrolling and hidden scrollbar (iOS)
jihun202
2020. 7. 8. 10:01
반응형
I just played with this CodePen and it seems that if you set the background-color to transparent for all three properties below (and in this example also remove box-shadows), the scrollbar is not visible at all:
#style-1::-webkit-scrollbar-track {
// -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.1);
background-color: transparent;
}
#style-1::-webkit-scrollbar {
background-color: transparent;
}
#style-1::-webkit-scrollbar-thumb {
// -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3);
background-color: transparent;
}
This was tested in Chrome Desktop, Chrome for Android, and iOS Safari (v8.4) on an iPhone 6+.
I would however recommend for user experience (usability/accessibility) to keep the scrollbar visible though, as even I, knowing what I was doing, got a bit confused when there was no scrollbar.
반응형