2024年5月11日发(作者:)
font-size:0;
}
.box p{
vertical-align:middle;
display:inline-block;
font-size:16px;
}
.box:after{
content:'';
width:0;
height:100%;
display:inline-block;
vertical-align:middle;
}
5.绝对定位负距离
.box{
position:relative;
}
.box p{
position: absolute;
width:100px;
height: 50px;
top:50%;
left:50%;
margin-left:-50px;
margin-top:-25px;
text-align: center;
}
6.绝对定位0
.box p{
width: 50%;
height: 50%;
background:
red;
overflow: auto;
margin: auto;
position: absolute;
top: 0; left: 0; bottom: 0; right: 0;
}
发布评论