Last active
March 3, 2017 18:46
-
-
Save Farmatique/d6aa1fe9e5d6b15052ec17a9afa0cf6f to your computer and use it in GitHub Desktop.
Center image <img> inside block
This file contains hidden or 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
| /* doesnt work on ios */ | |
| <div class="container"> | |
| <img /> | |
| </div> | |
| .container{ | |
| width: 70px; | |
| height: 70px; | |
| -webkit-display: flex; | |
| -moz-display: flex; | |
| -ms-display: flex; | |
| -o-display: flex; | |
| display:-webkit-flex; | |
| display: flex; | |
| -webkit-align-items: center; | |
| -moz-align-items: center; | |
| -ms-align-items: center; | |
| -o-align-items: center; | |
| align-items: center; | |
| -webkit-justify-content: center; | |
| -moz-justify-content: center; | |
| -ms-justify-content: center; | |
| -o-justify-content: center; | |
| justify-content: center; | |
| } | |
| .container img{ | |
| max-width: none; /* optional */ | |
| min-width: initial; | |
| min-height: initial; | |
| height: auto; | |
| width: auto; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment