我几乎不敢问这个问题,因为这个问题看上去是轻而易举的,但在花了3个多小时的 st和谷歌之后,我不得不让它走。
On initial state, the div#container
is going to contain div#list-dynamic-2
, where I want div#list-dynamic-2
to use the div#container
s full height. Div#list-dynamic-1
is going to be inserted dynamically and is allowed to stretch up to 150px
. Once div#list-dynamic-1
s height reaches 150px
, I want div#list-dynamic-2
to use the remaining space of 150px
.
I would also be happy if someone could tell me that this is pointless to achieve with CSS only and should be done with JavaScript instead.
(Btw, this is a simple example to show the problem and real usage would be to move selected users into the upper div and allow it to use 1/2 of div#container
. Think of the upper div
as some kind of shopping cart for users.)