<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加上這麼一段:
雷雷
示範