css3:
#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>
结果:
cc3多余的文本显示省略号
h2{
display:-webkit-box; -webkit-box-orient:horizontal; box-orient:horizontal; overflow:hidden; text-overflow:ellipsis; -webkit-line-clamp:2; -webkit-box-orient:vertical;
}