flex 相关练习骰子
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<style>
*{margin: 0;padding: 0;}
.main{
display: flex;
width: 1400px;
height: 300px;
margin: 100px auto;
align-items: center;
justify-content: space-around;
}
ul{
padding: 10px;
box-sizing: border-box;
list-style: none;
width: 200px;
height: 200px;
border-radius: 20px;
box-shadow: 0 0 5px 0 #999999;
display: flex;
flex-wrap: wrap;
}
ul li{
width: 50px;
height: 50px;
background-color: red;
border-radius: 50%
}
.one{
justify-content: center;
align-items: center;
}
.one li{
width: 100px;
height: 100px;
}
.two{
align-items: center;
justify-content: space-around;
}
.three{
justify-content: space-around;
}
.three li:nth-child(2){
align-self: center;
}
.three li:last-child{
align-self: flex-end;
}
.four{
align-items: center;
justify-content: space-around;
}
.four li{
margin: 0 10px;
}
.five{
align-items: center;
justify-content: space-around;
}
.five li:nth-child(2){
margin-left: 50px;
}
.five li:nth-child(3){
margin: 0 50px;
}
.five li:nth-child(5){
margin-left: 50px;
}
.six{
justify-content: space-around;
align-items: center;
}
</style>
</head>
<body>
<div class="main">
<ul class="one">
<li></li>
</ul>
<ul class="two">
<li></li>
<li></li>
</ul>
<ul class="three">
<li></li>
<li></li>
<li></li>
</ul>
<ul class="four">
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
<ul class="five">
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
<ul class="six">
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>
</body>
</html>
屏幕快照 2017-09-11 下午7.23.00.png