Skip to content

Instantly share code, notes, and snippets.

@shivamsupr
Last active May 25, 2017 08:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shivamsupr/8fa715310db538eebed3abf2a375b5af to your computer and use it in GitHub Desktop.
Save shivamsupr/8fa715310db538eebed3abf2a375b5af to your computer and use it in GitHub Desktop.
Make div or list scroll horizontally with overflow hidden
/*
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