Last active
September 26, 2016 19:33
-
-
Save TimothyClayton/259f4d8dc0af7f49601e to your computer and use it in GitHub Desktop.
Easy vertical centering haml/bootstrap3
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
// Seen lots of solutions but none for haml, and w/o display:flex to support older browsers. | |
// Utilize the little known whitespace removal syntax...the '<' and '>' below (after class declarations). | |
.row | |
.col-md-1.v-center< | |
= image_tag "ello.png" | |
.col-md-11.v-center> | |
%p Hooray! that's what I was going for, and it wasn't hard at all |
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
.v-center { | |
display:inline-block; | |
vertical-align:middle; | |
float:none; | |
} | |
.v-center p { | |
margin:0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment