This split screen design resembles the layout presented in this example: http://codepen.io/rileyjshaw/pen/vGLvVo
I am looking to incorporate a scroll down button on this layout. How can I position this button at the center and bottom of the window?
Below is the HTML code snippet:
.half
p These panels consistently divide the window correctly.
.half
p
| Created using only CSS with just 5 rules.
span.social
| by
a[target='_blank' href='https://twitter.com/rileyjshaw'] rileyjshaw
|.
CSS:
// Maximum aspect ratio before switching to a vertical split.
$ASPECT_W: 4
$ASPECT_H: 3
// Complete solution:
body
display: flex
flex-wrap: wrap
.half
width: 100%
flex-basis: $ASPECT_W / ($ASPECT_W + $ASPECT_H) * 100vh
flex-grow: 1
// Additional styling for visual appeal:
html, body
height: 100%
width: 100%
margin: 0
.half
position: relative
font: 600 32px Poppins, sans-serif
color: #f6e8ea
background: #ef626c
+ .half
background: #84dcff
p
position: absolute
top: 50%
left: 50%
transform: translate(-50%, -50%)
width: 72%
margin: 0
text-align: center
.social
display: block
max-height: 0
opacity: 0
animation: appear 1s 4s
a
color: #f9eef0
@keyframes appear
50%
max-height: 2em
opacity: 0
100%
max-height: 2em
opacity: 1