Created
January 6, 2019 17:34
-
-
Save sarvar/62df751e280b6e9319e49e90624255ba to your computer and use it in GitHub Desktop.
Vertical and Horizontal align center
This file contains hidden or 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
| <div class="full-height"> | |
| <div class="vertical-center"> | |
| <div class="row justify-content-center"> | |
| <div class="col-md-4 col-sm-6 col-12"> | |
| <h1>Some Text</h1> | |
| </div> | |
| </div> | |
| </div> | |
| </div> |
This file contains hidden or 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
| .full-height{ | |
| height: calc(100vh - 360px); | |
| min-height: 100%; | |
| display: table; | |
| width: 100%; | |
| } | |
| .vertical-center{ | |
| display: table-cell; | |
| text-align: center; | |
| vertical-align: middle; | |
| } | |
| .row{ | |
| display: flex; | |
| -webkit-flex-wrap: wrap; | |
| -ms-flex-wrap: wrap; | |
| flex-wrap: wrap; | |
| } | |
| .justify-content-center { | |
| -webkit-box-pack: center!important; | |
| -webkit-justify-content: center!important; | |
| -ms-flex-pack: center!important; | |
| justify-content: center!important; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment