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

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.

主站蜘蛛池模板: 大荔县| 东阿县| 东至县| 六枝特区| 仁寿县| 日土县| 叙永县| 华容县| 秦皇岛市| 化德县| 堆龙德庆县| 吉安市| 南汇区| 射洪县| 嘉峪关市| 哈密市| 阿拉善左旗| 永宁县| 禹城市| 来宾市| 临湘市| 镇原县| 娱乐| 海宁市| 大同市| 突泉县| 长阳| 陵水| 内乡县| 从化市| 图木舒克市| SHOW| 高淳县| 屯门区| 奎屯市| 澄迈县| 台前县| 遂昌县| 榆社县| 微山县| 丰原市|