Edit in JSFiddle


              
            
          
            
              
                
<div class="vertical-container elem">
    <span class="label begin"> &lt;div class="vertical-container"&gt; </span>
    
   <div class="elem elem-orange vertically-centered">
   <span class="label begin"> &lt;div class="vertically-centered"&gt; </span>
       <p>CSS里总算是有了一种简单的垂直居中布局的方法了!</p>
       <span class="label end"> &lt;/div&gt; </span>
   </div>
    
    
        <span class="label end"> &lt;/div&gt; </span>
</div>
* {
  -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
          box-sizing: border-box;
}
.elem{
    border:solid #6AC5AC 3px;
    position:relative;
}
.elem-red {
    border: solid #D64078 3px;
}
.elem-orange {
    border: solid #FDC72F 3px;
}
.elem-green {
    border: solid #96C02E 3px;
}
.label{
    position:absolute;
    background-color:#6AC5AC;
    line-height:1em;
    padding:3px;
}
.elem-red > .label{
    background-color:#D64078;
}
.elem-orange > .label{
    background-color:#FDC72F;
}
.begin{
    left:0;
    top:0;
}
.end{
    right:0;
    bottom:0;
}
p{
    margin:2em 0;
    display:block;
}

.vertical-container {
  display: -webkit-flex;
  display: flex;
  height: 300px;
}
.vertically-centered {
  margin: auto;
}