[CSS] Change the off-axis Alignment of a Flexed Container with `align-items`

We changed the axis layout with 'justify-content', and the "off axis" layout is controlled by 'align-items'. The most common values are flex-startflex-end, or center.

body {
  display: flex;
  flex-direction: row;
}

.container {
  background-color: #ebb871;
  display: flex;
  flex-direction: column;
  justify-content: space-between;

  align-items: flex-start;
  align-items: flex-end;
  align-items: center
}
<body>
    <div class="container">
        <div class="Box1 red"></div>
        <div class="Box2 green"></div>
        <div class="Box3 blue"></div>
    </div>
</body>

 

<iframe height="240" src="https://codesandBox.io/embed/flex-3-b765q?fontsize=14" style="width: 100%; height: 500px; border: 0; border-radius: 4px; overflow: hidden;" title="flex-3" width="320"></iframe>

相关文章

一:display:flex布局display:flex是一种布局方式。它即可以...
1. flex设置元素垂直居中对齐在之前的一篇文章中记载过如何...
移动端开发知识点pc端软件和移动端apppc端软件是什么,有哪些...
最近挺忙的,准备考试,还有其他的事,没时间研究东西,快周...
display:flex;把容器设置为弹性盒模型(设置为弹性盒模型之后...
我在网页上运行了一个Flex应用程序,我想使用Command←组合键...