簡體   English   中英

在Flex-Box內使孩子的身高相同

[英]Make height of the children same inside flex-box

我有一個display: flexdiv display: flex和兩個孩子div說.left.right .left.right的內容大小不同。 我想為孩子們設置相同的身高

這是最小的工作代碼

 .container{ display: flex; align-items: center } .left, .right{ width: 50%; } .right{ background: blue; height: 100%; } .left{ background: green; height: 100%; } 
 <div class="container"> <div class="left"> <span>this dis also should have same width as right div</span> </div> <div class="right"> orem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. </div> </div> 

這是提琴的問題

注意 :首選解決方案而不使用position: absolute會破壞我的實際網站

去除高度:100%; 它將解決此問題.. flexbox將其高度應用於孩子本身。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM