Last active
December 31, 2017 21:18
-
-
Save justiny/93dd357c3fa3cf82e3bc04287bfe4674 to your computer and use it in GitHub Desktop.
Flexbox Absolute Centered 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
/* Vertical align | |
https://chriswrightdesign.com/experiments/flexbox-adventures/# | |
*/ | |
.d-flex-vertical { | |
/* Tell flexbox to start vertically from the center */ | |
align-items:center; | |
display:flex; | |
/* I'm also aligning it horizontally */ | |
justify-content:center; | |
} | |
/* all the child element needs is to be a flex item */ | |
.d-flex-vertical > div { | |
display:flex; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment