我有div
與display: flex
和兩個孩子div說.left
和.right
。 .left
和.right
的內容大小不同。我想爲孩子設置相同的高度讓孩子的高度在柔性箱內相同
這裏是一個很小的工作代碼
.container{
\t display: flex;
\t align-items: center
}
.left, .right{
\t width: 50%;
}
.right{
\t background: blue;
\t height: 100%;
}
.left{
\t background: green;
\t height: 100%;
}
<div class="container">
\t <div class="left">
\t \t <span>this dis also should have same width as right div</span>
\t </div>
\t <div class="right">
\t \t 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.
\t </div>
</div>
這裏是Fiddle的問題
注意 :無需申請即可享受解決方案g position: absolute
因爲它會破壞我的實際網站
http://stackoverflow.com/a/33815389/3597276 –