标签:
css:
#dd{
height: 300px;
background: #0000cc;
display: -webkit-box;
display: flex;
display: -webkit-flex;
-webkit-justify-content: center;
-webkit-box-pack: center;
justify-content: center;
flex-direction: column;
-webkit-flex-direction: column;
-webkit-box-orient: vertical;
}
.ds{
height: 100px;
background: red;
}
HTML:
<div id="dd">
<div class="ds"></div>
</div>
结果:
标签:
原文地址:http://www.cnblogs.com/tanghongbo/p/4744430.html