Created
October 11, 2012 02:32
-
-
Save DeviaVir/3869830 to your computer and use it in GitHub Desktop.
Vertical centering with images and Firefox?
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
/** | |
* Vertical centering with images and Firefox? | |
*/ | |
html, body { height: 100%; } | |
body { | |
width: 100%; /* needed for FF */ | |
height: 100%; | |
margin: 0; | |
/* Flexbox hawtness */ | |
display: box; display: flexbox; | |
box-align: center; flex-align: center; | |
box-pack: center; flex-pack: center; | |
} | |
img { | |
padding: 1em 1.5em; | |
/* Fallback to look decent w/out Flexbox */ | |
max-width: 100em; | |
max-height:100em; | |
margin: 1em auto; | |
width: 80px; /* This changes the height!? */ | |
height: 10080px; /* This changes nothing!? */ | |
/* Make it pretty */ | |
} |
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
<img src="https://chase.sillevis.net/c.png" /> |
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
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment