1
A
回答
2
1
Flexbox,就應該有這方面的工作。
首先,在父容器上設置display: flex
和align-items: center
。
其次,在右邊的容器上設置display: flex
然後flex-direction: column
。
圖像將垂直對齊。
.container {
display: flex;
align-items: center;
}
.left {
margin-right: 10px;
}
.right {
display: flex;
flex-direction: column;
}
.right img {
margin: 5px 0;
}
<div class="container">
<div class="left">
<img src="http://placehold.it/320">
</div>
<div class="right">
<img src="http://placehold.it/150x100">
<img src="http://placehold.it/150x100">
<img src="http://placehold.it/150x100">
</div>
</div>
相關問題
- 1. 垂直對齊div內的img元素
- 2. 垂直對齊IMG
- 3. 中心h1垂直和水平在一個img元素中
- 4. 在img元素
- 5. HTML和顯示<img/>元素
- 6. CSS垂直堆棧
- 7. 垂直文本旁邊的垂直線
- 8. 垂直堆疊html元素
- 9. 垂直對齊李元素裏面的IMG
- 10. 引導 - 中心IMG行垂直
- 11. img in div浮動左邊文字垂直和水平居中
- 12. Selenium:找到「其他元素旁邊的元素」
- 13. 元素旁邊的其他元素的Zend表格
- 14. Ckeditor disallow img元素
- 15. 在浮動div的中間水平和垂直對齊img元素
- 16. 顯示:塊不堆棧導航元素
- 17. SQLite的垂直堆棧
- 18. 垂直堆棧按鈕
- 19. 在顯示中心對齊img:內嵌塊元素
- 20. 在IE中顯示IMG內嵌浮動元素
- 21. JSP:元素創建<img></img>元素
- 22. 重新顯示其他img在同一個jlabel上的困難
- 23. 垂直對齊img內浮動div
- 24. 如何垂直對齊img和h4?
- 25. 將span元素放置在圖像旁邊,但是垂直居中
- 26. 如何中心垂直浮動元素,包含元素結垢問題,IMG元素的大小問題
- 27. 如何在html/css中的圖像旁邊顯示垂直居中文本?
- 28. 在TinyMCE中顯示一個元素旁邊的按鈕
- 29. 將SelectedItem細節顯示在其旁邊
- 30. 在Matlab中垂直堆棧單元的組件?
謝謝,我會嘗試。我從來沒有想到,但我認爲它應該工作。 – 5AMWE5T
歡迎您。它會工作。試圖對齊兩個元素比五個更容易。 –