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

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.

主站蜘蛛池模板: 新安县| 淳安县| 青川县| 扶绥县| 长阳| 保靖县| 拜城县| 清流县| 韶关市| 和平县| 额济纳旗| 宁明县| 白朗县| 和龙市| 武功县| 定州市| 龙井市| 吉林省| 余姚市| 繁峙县| 玛曲县| 环江| 寿阳县| 濉溪县| 文登市| 上高县| 额济纳旗| 遵义县| 儋州市| 福海县| 通道| 来宾市| 方山县| 丰原市| 罗定市| 淳安县| 松潘县| 徐汇区| 山阳县| 双流县| 龙江县|