我有一個div
它的高度是固定的。在div
裏面有兩個divs
,其中高度由於divs
內的內容而動態變化。根據內容動態更改div高度,並在溢出時設置垂直滾動條。
<div id="panel">
<div id="layerTree">
</div>
<div id="features">
<div id="accordion_equip"></div>
<div id="accordion_equip"></div>
</div>
</div>
裏面features div
有兩個divs
有手風琴。無論何時當我們點擊該手風琴時,由於手風琴的數據features div
應該有一個垂直滾動條。
但是,當我們爲features div
設置固定高度時會出現垂直滾動條。但我無法設置固定高度,因爲layerTree div
高度也會根據裏面的內容而變化。
那麼,如何解決這個問題呢?
CSS:
#panel {
width: 20%;
height: 100%;
float: right;
position: relative;
top: 5px;
}
#features {
height: 365px;
overflow-y: auto;
}
可惜我不能附上由於安全限制當前UI的任何圖像。
上述*安全限制*還禁止您創建問題的[mcve]嗎?如果您不得不... –
@AndreiGheorghiu正在處理它 –
我可以指望您要求的任何小提琴或圖像嗎?所以我可以修復它 –