-
-
Save onero/5c6959aa0793aebab502f0807b904937 to your computer and use it in GitHub Desktop.
Centering elements (other than texts) inside a <ion-col></ion-col> is painful. Apply the following CSS in your respective component level scss or global theme to align items centrally.
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
.center{ | |
display: -webkit-box; | |
display: -moz-box; | |
display: -ms-flexbox; | |
display: -webkit-flex; | |
display: flex; | |
-webkit-box-direction: normal; | |
-moz-box-direction: normal; | |
-webkit-box-orient: horizontal; | |
-moz-box-orient: horizontal; | |
-webkit-flex-direction: row; | |
-ms-flex-direction: row; | |
flex-direction: row; | |
-webkit-flex-wrap: nowrap; | |
-ms-flex-wrap: nowrap; | |
flex-wrap: nowrap; | |
-webkit-box-pack: center; | |
-moz-box-pack: center; | |
-webkit-justify-content: center; | |
-ms-flex-pack: center; | |
justify-content: center; | |
-webkit-align-content: stretch; | |
-ms-flex-line-pack: stretch; | |
align-content: stretch; | |
-webkit-box-align: center; | |
-moz-box-align: center; | |
-webkit-align-items: center; | |
-ms-flex-align: center; | |
align-items: center; | |
}; |
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
<ion-row> | |
<ion-col class="center"> | |
<!-- your element here --> | |
</ion-col> | |
</ion-row> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment