Skip to content

Instantly share code, notes, and snippets.

@mcfog
Created November 3, 2014 11:17
Show Gist options
  • Save mcfog/6a68cce89263ae206545 to your computer and use it in GitHub Desktop.
Save mcfog/6a68cce89263ae206545 to your computer and use it in GitHub Desktop.
less垂直居中
.vertical-align-middle(@child: ~".content") {
&:before {
display: inline-block;
content: '';
height: 100%;
vertical-align: middle;
margin-right: -0.25em;
}
@{child} {
display: inline-block;
vertical-align: middle;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment