官术网_书友最值得收藏!

Vertical flex items

Flex items can also be arranged vertically in columns. This time, we flip the width and height dimensions of the parent so that it is three times as high as it is wide:

.flex-container-col {
display: flex;
flex-direction: col;
width: 150px;
height: 450px;
}
...

<div class="flex-container-col">
<!-- 1 flex item -->
<amp-img src="img/placeholder.png" layout="flex-item"></amp-img>
</div>

<div class="flex-container-col">
<!-- 2 flex items -->
<amp-img src="img/placeholder.png" layout="flex-item"></amp-img>
<amp-img src="img/placeholder.png" layout="flex-item"></amp-img>
</div>
...

<div class="flex-container-col">
<!-- 7 flex items -->
<amp-img src="img/placeholder.png" layout="flex-item"></amp-img>
<amp-img src="img/placeholder.png" layout="flex-item"></amp-img>
...
</div>
Vertical flex items being distorted depending on how many there are

Again, note how the flex items are distorted in the preceding examples. This is fine for containers, but it might not be what you're after when it comes to images.

主站蜘蛛池模板: 泸溪县| 将乐县| 石屏县| 清丰县| 玛沁县| 屏东市| 华亭县| 宜兰市| 彭水| 伽师县| 乐清市| 巴青县| 丰县| 吉林省| 阿勒泰市| 江达县| 富阳市| 洛川县| 河曲县| 德昌县| 朔州市| 万源市| 武川县| 饶阳县| 天长市| 阿拉善右旗| 酉阳| 丹阳市| 象州县| 女性| 肇东市| 新蔡县| 伊吾县| 沁源县| 长白| 海伦市| 珲春市| 沛县| 海盐县| 兰溪市| 温泉县|