<style>
#test{
width:100px;
height:100px;
position:absolute;
left:50%;top:50%;
margin:-50px 0 0 -50px;
background-color:#000
}
</style>
<div id="test"></div>
div在整个页面实现垂直居中
最新推荐文章于 2023-10-02 07:49:57 发布
<style>
#test{
width:100px;
height:100px;
position:absolute;
left:50%;top:50%;
margin:-50px 0 0 -50px;
background-color:#000
}
</style>
<div id="test"></div>