Correcting teacher:天蓬老师
Correction status:qualified
Teacher's comments:布局大处着眼, 心中一定先有蓝图, 这才能做到心中有数, 知道自己要什么?
display:flex
flex-direction
flex-wrap
flex-flow
上面两个的简写,第一个值是方向,第二值是换行justify-content
justify-content
align-items
align-content
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
.container {
width: 600px;
height: 300px;
border: 1px solid red;
/*转换为盒模型*/
display: flex;
/*换行显示*/
flex-wrap: wrap;
/*水平排列*/
flex-direction: row;
/*将主轴剩余空间平均分配,所有元素的空间都相等*/
justify-content: space-evenly;
/*交叉轴上的排列方式(单行)*/
/*align-items: center;*/
/*多行*/
align-content: flex-start;
}
.item {
width: 100px;
height: 100px;
border: 1px solid purple;
}
</style>
</head>
<body>
<div class="container">
<span class="item">1</span>
<span class="item">2</span>
<span class="item">3</span>
<span class="item">4</span>
<span class="item">5</span>
<span class="item">6</span>
</div>
</body>
</html>