flex 弹性容器六个属性练习(代码写错了,重新提交)
先上传下代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>flex属性应用</title>
<style>
.container {
width: 600px;
height: 300px;
border: 1px dashed;
/*只要盒子加了padding,border 就马上加上box-sizing*/
box-sizing: border-box;
background-color: lightskyblue;
}
.item {
width: 200px;
height: 50px;
border: 1px dashed;
background-color: wheat;
}
.container {
display: flex;
}
.container {
/*设置不同的属性会产生不同的排列效果*/
/*flex-direction: row;*/
/*flex-direction: column;*/
flex-wrap: wrap;
/*flex-flow: row wrap;*/
/*justify-content: center;*/
/*align-items: center;*/
/*align-content: space-evenly;*/
}
</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>
<span class="item">7</span>
</div>
</body>
</html>
手写作业: