Created
September 22, 2016 09:04
-
-
Save tyaslab/7aaea4b1c6d8eeb0c2e29e4e44eeeb14 to your computer and use it in GitHub Desktop.
Center Vertically No Fixed Width
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
<div class="v-center"> | |
<div class="inner"> | |
Centered Horizontally and Vertically | |
<img src="https://placeholdit.imgix.net/~text?txtsize=33&txt=120%C3%9770&w=120&h=70"> | |
</div> | |
</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
.v-center { | |
padding-top: 30px; | |
padding-bottom: 30px; | |
background-color: green; | |
text-align: center; | |
} | |
img { | |
vertical-align: middle; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment