.box5 {
justify-content: space-between;
}
.box5 div {
display: flex;
flex-direction: column;
justify-content: space-between;
}
注意选择器的优先级
.box5 .center {
/* align-self: center; */
justify-content: center;
}
完整代码
<style>
/* 五点 */
.box {
padding: 12px;
width: 100px;
height: 100px;
border: 1px solid black;
border-radius: 8px;
margin-bottom: 10px;
display: flex;
}
span {
width: 30px;
height: 30px;
background-color: black;
border-radius: 15px;
}
.box5 {
justify-content: space-between;
}
.box5 div {
display: flex;
flex-direction: column;
justify-content: space-between;
}
.box5 .center {
/* align-self: center; */
justify-content: center;
}
</style>
</head>
<body>
<div class="box box5">
<div class="left">
<span></span>
<span></span>
</div>
<div class="center">
<span></span>
</div>
<div class="right">
<span></span>
<span></span>
</div>
</div>
</body>
标签:flex,骰子,center,五点,space,content,box5,justify
From: https://www.cnblogs.com/poco-o/p/16823932.html