I am using the flex layout, through the technique to generate a square, and now the red square is centered, but the position is abnormal and floats directly to the top, what is the reason?
`
< html lang= "en" >
< head >
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
-sharpapp{
margin: auto auto;
width : 600px;
height : 800px;
background-color : -sharpcccccc;
}
.d1{
width: 100%;
height: 0;
padding-bottom: 100%;
background-color: -sharp656565
}
.d2{
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
box-sizing: border-box;
position: relative
}
.clo{
position: absolute;
width: 200px;
height:200px;
background: red;
}
</style>
< / head >
< body >
<div id="app">
<div class="d1">
<div class="d2">
<div class="clo"></div>
</div>
</div>
</div>
< / body >
< / html >
`
according to my observation, the picture is automatically aligned with the middle position of .d1, but I clearly set up box-sizing=border-box, why did he still run out of this box?
Thank you < del > ~ < / del > < del > ~ < / del > ~