在HTML中将flex-flow设置为自动换行时的Flex容器宽度
如果您有一个具有flexheight和displayflex的容器,那么如果要将子级放置在列中,请遵循此步骤。
进行设置更改:
-webkit-flex-flow: column wrap;
为此,Chrome浏览器会自动在div和bordertop之间添加空格。如果我们不想自动添加空间,则可以使用:
margin-bottom:100%;
这将向上移动项目
.flex-container {
position: fixed;
height: 80%;//this will change height of flex container to 80%
padding: 1;
margin: 1; // this will change margin to 1
list-style: none;
border: 7px solid red; // this will change border to solid red
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-flex-flow: column wrap;
justify-content: flex-start
align-content: flex-start;
align-items: flex-start
}
/** Just to show the elements */
body {
margin: 0;
padding: 0;
}
.flex-item {
background: tomato;
padding: 5px;
width: 100px;
height: 100px;
margin-bottom: 100%;
line-height: 150px;
color: white;
font-weight: bold;
font-size: 3em;
text-align: center;
}
<ul class="flex-container">
<li class="flex-item">1</li>
<li class="flex-item">2</li>
<li class="flex-item">3</li>
<li class="flex-item">4</li>
<li class="flex-item">5</li>
<li class="flex-item">6</li>
</ul>热门推荐
1 狗狗技能训练
5 如何训练狗狗笑
6 狗狗训练排便
9 狗狗响片训练
10 如何训练狗狗不捡食
11 狗狗尿训练
12 怎么训练狗狗找东西
13 狗狗训练站立
14 狗狗训练飞盘
15 鞍山狗狗训练
16 怎样训练泰迪狗狗谢谢
17 狗狗外出训练
18 怎么训练金毛狗狗大小便