Last active
August 29, 2015 14:05
-
-
Save SafeerH/a6c6e0851756d72cb650 to your computer and use it in GitHub Desktop.
Show the top and bottom inset-shadows to a scrollable div
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
.scrollbox { | |
overflow: auto; | |
width: 200px; | |
max-height: 200px; | |
margin: 50px auto; | |
background: | |
/* Shadow covers */ | |
linear-gradient(white 30%, rgba(255,255,255,0)), | |
linear-gradient(rgba(255,255,255,0), white 70%) 0 100%, | |
/* Shadows */ | |
radial-gradient(50% 0, farthest-side, rgba(0,0,0,.2), rgba(0,0,0,0)), | |
radial-gradient(50% 100%,farthest-side, rgba(0,0,0,.2), rgba(0,0,0,0)) 0 100%; | |
background: | |
/* Shadow covers */ | |
linear-gradient(white 30%, rgba(255,255,255,0)), | |
linear-gradient(rgba(255,255,255,0), white 70%) 0 100%, | |
/* Shadows */ | |
radial-gradient(farthest-side at 50% 0, rgba(0,0,0,.2), rgba(0,0,0,0)), | |
radial-gradient(farthest-side at 50% 100%, rgba(0,0,0,.2), rgba(0,0,0,0)) 0 100%; | |
background-repeat: no-repeat; | |
background-color: white; | |
background-size: 100% 40px, 100% 40px, 100% 14px, 100% 14px; | |
/* Opera doesn't support this in the shorthand */ | |
background-attachment: local, local, scroll, scroll; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment