- AMP:Building Accelerated Mobile Pages
- Ruadhan O'Donoghue
- 91字
- 2021-07-08 10:04:08
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.
推薦閱讀
- UML和模式應用(原書第3版)
- NLTK基礎教程:用NLTK和Python庫構建機器學習應用
- Java加密與解密的藝術(第2版)
- 營銷數據科學:用R和Python進行預測分析的建模技術
- OpenStack Cloud Computing Cookbook(Fourth Edition)
- GeoServer Beginner's Guide(Second Edition)
- C語言程序設計案例精粹
- HTML5入門經典
- Python算法從菜鳥到達人
- Mastering JavaScript Design Patterns(Second Edition)
- 大學計算機基礎
- Visual Basic語言程序設計基礎(第3版)
- Mastering OpenStack
- Developing Java Applications with Spring and Spring Boot
- AngularJS UI Development