<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.box {
width: 300px;
height: 300px;
border: 1px #ccc solid;
border-radius: 10px;
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 20px;
}
.item{
width: 50px;
height: 50px;
background-color: black;
border-radius: 50%;
}
.item:first-child{
align-self: flex-start;
}
.item:nth-child(2) {
align-self: center;
}
.item:last-child {
align-self: flex-end;
}
</style>
</head>
<body>
<div class="box">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>
</body>
</html>
3点骰子效果:
图片