Skip to content

Instantly share code, notes, and snippets.

@EastSideCode EastSideCode/style.css
Last active May 7, 2018

Embed
What would you like to do?
Vertical align floating images the easy way
.image-container {
height: 200px; /* can be whatever */
}
.image-container:before {
content: ' ';
display: inline-block;
vertical-align: middle;
height: 100%;
}
.image-container img {
width: 100%;
height: auto;
display: inline-block;
vertical-align: middle;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.