<div class="box">
<div class="Abox"> 我是刷黄飞鸿我是刷黄飞鸿我是刷黄飞鸿我是刷黄飞鸿 我是刷黄飞鸿 你钢结构 </div>
</div>
*{
padding:0;
margin: 0;
}
html,body{
width: 100%;
height: 100%;
}
.box{
background: red;
width: 100%;
height: 100%;
position: relative;
}
.Abox{
position: absolute;
/* top:0;
left:0;
right:0;
bottom:0;
margin:auto; */
top:50%;
left:50%;
transform:translate(-50%,-50%);
background: yellow;
font-size: 20px;
width: 20%;
height: 0;
padding-bottom: 10%; //20%*0.5
overflow:auto;
}
}