0
我掙扎着爬在左,右列中的內容是垂直方向的中間對齊CSS:Flex的高度相等的列和垂直中心內容
https://jsfiddle.net/kLm7j7zq/
<div class="equalizer">
<div class="block1">
<div class="inner"><p>
Block 1
</p></div>
</div>
<div class="content">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Labore, vel, quia. Non nostrum, consectetur ipsum doloribus enim maiores a laudantium, odio vel blanditiis id ea dolorum expedita fugit incidunt commodi.Lorem ipsum dolor sit amet, consectetur adipisicing elit. Labore, vel, quia. Non nostrum, consectetur ipsum doloribus enim maiores a laudantium, odio vel blanditiis id ea dolorum expedita fugit incidunt commodi.Lorem ipsum dolor sit amet, consectetur adipisicing elit. Labore, vel, quia. Non nostrum, consectetur ipsum doloribus enim maiores a laudantium, odio vel blanditiis id ea dolorum expedita fugit incidunt commodi.</div>
<div class="block2"><div class="inner2"><p>
Block 2
</p></div></div>
</div>
SCSS
.equalizer{
display: flex;
flex-direction: row;
align-content: center;
*{
display: flex;
background: pink;
flex:1;
align-content: center;
}
.block2{background: yellow;}
}
如何解決這個問題,並且重要的是讓它在Safari上工作和Chrome?
謝謝!任何方式我可以有塊2(與黃色bg)是相同的高度? – ultimatecoder
'.block1,.inner2 {align = self; center; }' – bhv
太好了!再次感謝! – ultimatecoder