Skip to content

Instantly share code, notes, and snippets.

@Akifcan
Created March 31, 2021 12:34
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 Akifcan/9eeff14490bb284127fbf4d4d9f569ac to your computer and use it in GitHub Desktop.
Save Akifcan/9eeff14490bb284127fbf4d4d9f569ac to your computer and use it in GitHub Desktop.
medium carousel article
.slider .slide-item {
cursor: grabbing;
scroll-snap-align: start;
flex-shrink: 0; /* We don't want to fit divs to parent element. So we'll use flex-shrink: 0 */
background-color: red;
width: 100%;
display: grid;
place-items: center;
font-size: 5rem;
}
.slide-item:nth-of-type(1) {
background: linear-gradient(
to right,
#000000,
#e74c3c
); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
}
.slide-item:nth-of-type(2) {
background: linear-gradient(
to right,
#485563,
#29323c
); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
}
.slide-item:nth-of-type(3) {
background: linear-gradient(
to right,
#556270,
#ff6b6b
); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment