Created
September 26, 2016 20:23
-
-
Save Lego2012/9199559fca35ac714233aa5f2f8d78cf to your computer and use it in GitHub Desktop.
This centers an image of unknown size vertically and horizontally within a box. The wrapper box has an explicit width and height. The is a hack for internet explorer
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
/* | |
<figure class='logo'> | |
<span></span> | |
<img class='photo'/> | |
</figure> | |
*/ | |
.logo { | |
display: block; | |
text-align: center; | |
display: block; | |
text-align: center; | |
vertical-align: middle; | |
border: 4px solid #dddddd; | |
padding: 4px; | |
height: 74px; | |
width: 74px; | |
} | |
.logo * { | |
display: inline-block; | |
height: 100%; | |
vertical-align: middle; | |
} | |
.logo .photo { | |
height: auto; | |
width: auto; | |
max-width: 100%; | |
max-height: 100%; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment