我遇到一些困難,利用Flexbox的時候在左下角定位的元素。 基本上我試圖讓「世界」的文字出現正下方的「你好」文本(即在實現Flexbox的左下角)。定位的div留下了Flexbox的
rel {
position: relative;
background: rgba(255, 0, 0, 0.5);
padding: 5px;
margin-top: auto;
}
abs {
position: absolute;
background: rgba(0, 255, 0, 0.5);
padding: 5px;
}
column {
display: flex;
flex-direction: column;
}
item {
display: flex;
align-items: center;
flex: auto;
border: 1px solid blue;
}
<column>
<item>
hello
<br>hello
<br>hello
<br>hello
<br>
<rel>
<abs>
world
<br/>world
<br/>world
<br/>world
<br/>
</abs>
</rel>
</item>
</column>
喜歡[即(https://jsfiddle.net/c5cbxw9q/1/)? – pol
這可以幫助:http://stackoverflow.com/a/33856609/3597276 –