我在柔版盒中並排放置2個div。右邊的一個應該總是相同的寬度,我想要左邊的一個只抓住剩餘的空間。但除非我專門設定寬度,否則不會。使柔版盒中剩餘的*水平*空間填充
所以目前,它被設置爲96%,這看起來不錯,直到你真的壓扁屏幕 - 然後右手div有點餓了它所需要的空間。
我想我可以離開它,因爲它是,但感覺錯了 - 就像必須有一個方式說:
正確的始終是相同的;您在左側 - 你得到剩下的
.ar-course-nav {
cursor: pointer;
padding: 8px 12px 8px 12px;
border-radius: 8px;
}
.ar-course-nav:hover {
background-color: rgba(0, 0, 0, 0.1);
}
<br/>
<br/>
<div class="ar-course-nav" style="display:flex; justify-content:space-between;">
<div style="width:96%;">
<div style="overflow:hidden; white-space:nowrap; text-overflow:ellipsis;">
<strong title="Course Name Which is Really Quite Long And Does Go On a Bit But Then When You Think it's Stopped it Keeps on Going for even longer!">
Course Name Which is Really Quite Long And Does Go On a Bit But Then When You Think it's Stopped it Keeps on Going for even longer!
</strong>
</div>
<div style="width:100%; display:flex; justify-content:space-between;">
<div style="color:#555555; margin-right:8px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;" title="A really really really really really really really really really really really long department name">
A really really really really really really really really really really really long department name
</div>
<div style="color:#555555; text-align:right; white-space:nowrap;">
Created: 21 September 2016
</div>
</div>
</div>
<div style="margin-left:8px;">
<strong>></strong>
</div>
</div>
剛剛意識到我從來沒有接受這個的答案! (我很抱歉。) –