1.div限高,内容长度只一行
.v-align{ /*设置div水平居中*/ margin: 0 auto; width: 200px; /*设置内容垂直居中===》height的值等于line-height的值*/
height: 80px; line-height: 80px; /*设置内容水平居中*/ text-align: center; background-color: yellow; border: 1px solid #000; }
<div class="v-align">我的内容只能有一行。</div>