2024年5月11日发(作者:)
border: 2px solid #ccc;
box-sizing: border-box;
}
non-child
(5):transform
(6):margin-top或margin-bottom
.wrap{
width:200px ;
height: 300px;
border: 2px solid #ccc;
box-sizing: border-box;
}
.div1{
width:100px ;
height: 100px;
box-sizing: border-box;
background: darkblue;
}
.margin{
margin-top: 100px;
}
(7):padding-top或padding-bottom
.wrap{
width:200px ;
height: 300px;
border: 2px solid #ccc;
box-sizing: border-box;
}
.padding{
padding-top: 100px;
}
.div1{
width:100px ;
height: 100px;
box-sizing: border-box;
background: darkblue;
}
(8):vertical-align:middle
.parent{
text-align: center;
line-height: 100px;
font-size: 0;
}
.child{
vertical-align: middle;
}
发布评论