Last active
May 25, 2017 08:07
-
-
Save shivamsupr/8fa715310db538eebed3abf2a375b5af to your computer and use it in GitHub Desktop.
Make div or list scroll horizontally with overflow hidden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Demo: | |
Codepen: https://codepen.io/shivamupr/full/GmeMOR/ | |
(Check it in mobile view mode) | |
List Scroll: https://vimeo.com/218911885 | |
Div Scroll: https://vimeo.com/218911851 | |
*/ | |
.scrl { | |
white-space: nowrap; | |
&--l { | |
overflow: hidden; | |
overflow-x: auto; | |
display: block; | |
&__f { | |
position: relative; | |
left: -5%; | |
width: 110%; | |
padding: 0 20px; | |
} | |
&::-webkit-scrollbar { | |
width: 0; | |
} | |
&::-webkit-scrollbar-track { | |
-webkit-box-shadow: inset 0 0 0 rgba(0, 0, 0, 0.3); | |
} | |
&::-webkit-scrollbar-thumb { | |
background-color: transparent; | |
outline: 1px solid transparent; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment