Last active
July 12, 2017 13:06
-
-
Save wandbferreira/ed28ff8181b6d2110ffa0d4f88c26204 to your computer and use it in GitHub Desktop.
Permite alinhamento Vertical
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 centralizada */ | |
.classe { | |
position: relative; | |
top: 50%; | |
-webkit-transform: translateY(-50%); | |
-ms-transform: translateY(-50%); | |
transform: translateY(-50%); | |
} | |
/* Imagem centralizada */ | |
.img-center{ | |
background: #FFF; | |
width: 100%; | |
padding-top: 75%; | |
padding-top: calc(75% - 20px); /* fix border-width */ | |
text-align: center; | |
margin: 0; | |
position: relative; | |
} | |
.img-center img{ | |
max-height: 100%; | |
max-width: 100%; | |
width: auto; | |
height: auto; | |
position: absolute; | |
top: 0; | |
bottom: 0; | |
left: 0; | |
right: 0; | |
margin: auto; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment