今天面试问到flex布局实现1-9骰子的排布,所以来总结一下。
数字一
|
|
数字二
|
|
注意 以下代码都基于这两个类1234567891011121314.container{ height: 150px; width: 150px; background-color: #ffcc99; border-radius: 5px; margin-top: 5px; } .item{ height: 40px; width: 40px; border-radius: 20px; background-color: black; margin: 5px; }
三
|
|
四
|
|
五
|
|
六
|
|
九
|
|
结果如图所示