Skip to content

Instantly share code, notes, and snippets.

@yutin1987
Last active August 29, 2015 14:11
Show Gist options
  • Save yutin1987/3a947aaabce18a7d85f1 to your computer and use it in GitHub Desktop.
Save yutin1987/3a947aaabce18a7d85f1 to your computer and use it in GitHub Desktop.
jEqXBK
<div class="box--middle">
<img src="http://images.sodahead.com/profiles/0/0/2/4/0/9/7/2/1/I-like-when-girls-kiss-girls-42672842512.jpeg">
</div>
.box--middle:before {
content: "";
display: inline-block;
height: 100%;
vertical-align: middle;
}
.box--middle {
text-align: center;
}
.box--middle > * {
vertical-align: middle;
}
/* 以下不重要 */
.box--middle {
background: #F1B1F1;
width: 200px;
height: 200px;
}
.box--middle img{
width: 120px;
height: 120px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment