<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
}
问题>>>>>>>>>>怎么保证这两个骰子不变的情况下,让他们对齐,不要一个低一个高
Put another layer of
on the outside of
p
, and then set the outermost layer ofp
toflex
.Like this:
Add this paragraph to css:
demo