代码拉取完成,页面将自动刷新
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>flex-flow</title>
<style>
* {
margin: 0;
padding: 0;
}
.content {
width: 900px;
height: 500px;
background-color: #ccc;
margin: 0 auto;
/* 设置父容器为伸缩布局, 子元素会自动变成伸缩项 */
display: flex;
/* 设置子元素的排列方式
flex-start 让子元素从父容器的·起始·位置开始排列
flex-end 让子元素从父容器的·结束·位置开始排列
center 让子元素从父容器的·中间·位置开始排列
space-between 左右对齐父元素的开始和结束位置,中间平均分页产生相同的间距
space-around 将多余的空间平均的分页在每一个元素的两边
*/
justify-content: center;
/* flex-flow: 是flex-wrap和flex-direction的综合
flex-wrap: 控制子元素是否换行显示,默认不换行
nowrap 不换行,则收缩
wrap 换行
wrap-reverse 翻转,原来是从上到下,翻转后就是从下到上排列
*/
flex-wrap: wrap;
/* flex-direction: 设置子元素的排列方式,就是用来设置主轴的排列方式,默认为row
row 水平排列,从左到右
cloumn 垂直排列方向 从上到下
row-reverse
column-reverse
*/
flex-direction: column
}
.first {
width: 200px;
height: 200px;
background-color: red;
}
.second {
width: 200px;
height: 200px;
background-color: green;
}
.third {
width: 200px;
height: 200px;
background-color: purple;
}
.fourth {
width: 200px;
height: 200px;
background-color: blue;
}
.fifth {
width: 200px;
height: 200px;
background-color: pink;
}
</style>
</head>
<body>
<div class="content">
<div class="first">1</div>
<div class="second">2</div>
<div class="third">3</div>
<div class="fourth">4</div>
<div class="fifth">5</div>
</div>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。