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

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.

主站蜘蛛池模板: 额尔古纳市| 通道| 浦北县| 鄱阳县| 大余县| 永安市| 鄱阳县| 邢台县| 淅川县| 将乐县| 尚义县| 交城县| 科技| 城市| 汨罗市| 寿宁县| 浏阳市| 静乐县| 浦县| 缙云县| 呈贡县| 电白县| 潼南县| 呈贡县| 龙州县| 东阿县| 凤城市| 肃宁县| 华蓥市| 康乐县| 常宁市| 阜平县| 广州市| 维西| 江门市| 永靖县| 新乐市| 灵璧县| 县级市| 朝阳市| 滕州市|