- 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.
推薦閱讀
- 嵌入式軟件系統測試:基于形式化方法的自動化測試解決方案
- Java EE 6 企業級應用開發教程
- Kubernetes實戰
- PyTorch自動駕駛視覺感知算法實戰
- The DevOps 2.5 Toolkit
- Visual Basic程序設計
- C# and .NET Core Test Driven Development
- 深入理解C指針
- 響應式Web設計:HTML5和CSS3實戰(第2版)
- Spring 5 Design Patterns
- JSP程序設計與案例實戰(慕課版)
- 青少年學Python(第2冊)
- Photoshop智能手機APP界面設計
- Joomla!Search Engine Optimization
- Apache Solr for Indexing Data