2
我想實現像標題和可滾動內容區域的常規窗口'窗口。所述.frame
收縮以適合其大小可變的內容,並且僅由max-width
/max-height
限於:如何在內容區域中製作具有最大高度和滾動條的收縮適配容器?
<div class="frame">
<div class="title">title</div>
<div class="content scrollable">content of variable width/height</div>
</div>
因此,基本上,沒有外width
/height
被設置時,.frame
width
/height
僅通過max-width
限制,max-height
,除了.frame
縮小以適應其內容。 結果將看起來像一個標題欄和變量width
/height
內容的常規窗口窗口,如果幀的height
/width
超過某些最大值,則該內容應滾動。
如何在CSS中完成?
WOW!我甚至沒有想過像添加顯示器這樣的瘋狂解決方案:固定;到.title!謝謝! CSS是如此瘋狂的世界! – 2011-05-30 18:17:18
如果這對您有效,您可以將答案標記爲「正確」! – Jawad 2011-05-30 18:22:57
不是「顯示:固定」,而是「位置:固定」 – Jawad 2011-05-30 18:24:13