Created
April 25, 2018 22:02
-
-
Save michaelbourne/8375c4a472047111f9e85ffc68ed2da9 to your computer and use it in GitHub Desktop.
Responsive Cornerstone Timeline
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
@media (min-width: 768px){ | |
.timeline { | |
position: relative; | |
z-index: 1; | |
} | |
.timeline::before { | |
content:""; | |
position: absolute; | |
z-index: 1; | |
top: 0; | |
bottom: 0; | |
display: block; | |
left: 50%; | |
border-left: 1px solid #000; /*change these border values to suit your liking*/ | |
} | |
.timeline .x-container:nth-child(odd)::after { | |
content:""; | |
z-index: 99999; | |
position: absolute; | |
right: 50%; | |
top: 50%; | |
width: 15px; | |
height: 15px; | |
transform: translateX(50%); | |
border-radius: 12px; | |
background: #000; | |
border: 2px solid rgb(224,224,224); | |
} | |
.timeline .x-container:nth-child(odd)::before { | |
content:""; | |
z-index: -1; | |
position: absolute; | |
right: 50%; | |
top: calc(50% + 7px); | |
width: 150px; | |
height: 1px; | |
background: #000; | |
} | |
.timeline .x-container:nth-child(even)::after { | |
content:""; | |
z-index: 99999; | |
position: absolute; | |
left: 50%; | |
top: 50%; | |
width: 15px; | |
height: 15px; | |
transform: translateX(-50%); | |
border-radius: 12px; | |
background: #000; | |
border: 2px solid rgb(224,224,224); | |
} | |
.timeline .x-container:nth-child(even)::before { | |
content:""; | |
z-index: -1; | |
position: absolute; | |
left: 50%; | |
top: calc(50% + 7px); | |
width: 150px; | |
height: 1px; | |
background: #000; | |
} | |
.timeline .x-container { | |
display:flex!important; | |
} | |
.timeline .x-container:nth-child(even) { | |
flex-direction: row-reverse; | |
} | |
.timeline .x-container:nth-child(even) .x-column { | |
margin-right: 0; | |
} | |
.timeline .x-container:nth-child(odd) .x-column:nth-child(1) { | |
text-align: right; | |
} | |
.timeline .x-container .x-column:nth-child(1) { | |
box-shadow:0px 5px 20px rgba(0,0,0 ,0.2); | |
} | |
} | |
.timeline .x-column:nth-child(1) { | |
background-color: #fff!important; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment