<p class="box dice1">
<span></span>
</p>
<p class="box dice2">
<span></span>
<span></span>
</p>
* {
padding: 0;
margin: 0;
}
span {
display: inline-block;
width: 100px;
height: 100px;
border-radius: 50px;
background-color: #000;
margin: 10px;
}
.box {
display: inline-flex;
width: 360px;
height: 360px;
border: 2px solid #000;
border-radius: 15px;
}
.dice1 {
flex-flow: row wrap;
justify-content: center;
}
.dice2 {
flex-flow: row nowrap;
justify-content: space-between;
align-items: center
}
问题>>>>>>>>>>怎么保证这两个骰子不变的情况下,让他们对齐,不要一个低一个高
外面再套一层
p
,然后最外面这层p
设定为flex
。像这样:
css加上这么一段:
demo