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

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.

主站蜘蛛池模板: 白河县| 莱州市| 府谷县| 寻乌县| 清水河县| 类乌齐县| 内丘县| 通化市| 隆安县| 且末县| 达州市| 阜南县| 汝城县| 施秉县| 工布江达县| 昔阳县| 泰安市| 上饶县| 漳州市| 蛟河市| 明水县| 嘉义市| 平武县| 龙泉市| 宝坻区| 甘南县| 修武县| 汶上县| 荥经县| 汉阴县| 南汇区| 辽宁省| 确山县| 九龙县| 宽城| 阿鲁科尔沁旗| 渝北区| 循化| 阿克| 阳江市| 赞皇县|