A Pen by Jordan Moore on CodePen.
Created
May 8, 2014 04:08
-
-
Save nladart/9256e6d8eb095d177838 to your computer and use it in GitHub Desktop.
horizontal scroll on small. Key parts of CSS are white space no wrap and overflow scroll touch
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
<div class="container"> | |
<ul> | |
<li><img src="http://placehold.it/250x175"></li> | |
<li><img src="http://placehold.it/250x175"></li> | |
<li><img src="http://placehold.it/250x175"></li> | |
<li><img src="http://placehold.it/250x175"></li> | |
<li><img src="http://placehold.it/250x175"></li> | |
<li><img src="http://placehold.it/250x175"></li> | |
<li><img src="http://placehold.it/250x175"></li> | |
<li><img src="http://placehold.it/250x175"></li> | |
<li><img src="http://placehold.it/250x175"></li> | |
<li><img src="http://placehold.it/250x175"></li> | |
</ul> | |
</div> |
A Pen by Jordan Moore on CodePen.
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
/* Begin demo styles */ | |
body { | |
font-family: 'Helvetica Neue', Arial, sans-serif; | |
} | |
a { | |
text-decoration: none; | |
} | |
/* End demo styles */ | |
.container { | |
max-width: 1140px; | |
margin: 0 auto; | |
text-align: center; | |
} | |
.container ul { | |
list-style-type: none; | |
padding: 0; | |
overflow-x: scroll; | |
white-space: nowrap; | |
-webkit-overflow-scrolling: touch; | |
} | |
@media screen and (min-width: 800px) { | |
.container ul { | |
white-space: normal; | |
} | |
} | |
.container ul li { | |
display: inline-block; | |
} | |
.container ul li a { | |
display: inline-block; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment