Skip to content

Instantly share code, notes, and snippets.

@leohxj
Last active December 22, 2015 15:38
Show Gist options
  • Select an option

  • Save leohxj/6493450 to your computer and use it in GitHub Desktop.

Select an option

Save leohxj/6493450 to your computer and use it in GitHub Desktop.
垂直居中方法
.Center-Container.is-Inline {
text-align: center;
width: 100%;
height: 100%;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
font-size: 0;
}
.Center-Container.is-Inline:after {
text-align: center;
content: '';
display: inline-block;
height: 100%;
vertical-align: middle;
margin-right: -.25em
}
.is-Inline .Center-Block {
display: inline-block;
vertical-align: middle;
width: 90%;
background: #2E5F3E;
}
#more {
font-size: 32px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment