2011-12-21 327 views
0

是否有可能在css中創建master-detail-states佈局?
我需要3 placeholderscss佈局(固定)

+---------------+-------+ 
|  A  | B | 
+-----------------------+ 
|   C   | 
+-----------------------+ 

Block A - 是orders列表。
Block B - 是選擇的順序
Block C的國家名單 - 是選擇順序

每個模塊都會有自己的垂直滾動條的詳細信息列表中,但整個頁面不能滾動 - 這意味着,每個塊總是在自己的地方,即使我有1000個訂單,1000個細節和1000個狀態。

是否可以用css做到這一點?

+1

是的,這是可能的。 – Scott 2011-12-21 09:47:04

+1

:)感謝您的希望:)但如何? – Lari13 2011-12-21 09:48:21

+1

你有什麼嘗試?什麼不適合你?還是你只是在尋找某人爲你寫代碼? – Scott 2011-12-21 09:49:11

回答

1

它實際上是一個非常直接的CSS佈局:

DEMO HERE

+0

謝謝,這就是我需要的! – Lari13 2011-12-21 10:02:41

+1

不客氣。在將來你真的應該在代碼中發佈你所在的位置,並解釋你所嘗試過的。 – Scott 2011-12-21 10:03:53

0

也許是這樣的:

<style type="text/css"> 
    .A, .B, .C 
    { 
    overflow: scroll; 
    } 

    .A, .B 
    { 
    display: inline-block; 
    height: 30%; 
    } 

    .A 
    { 
    width: 75%; 
    } 

    .B 
    { 
    width: 25%; 
    } 

    .C 
    { 
    width: 100%; 
    height: 70%; 
    } 

</style> 

<div class="A"></div> 
<div class="B"></div> 
<div class="C"></div> 

CSS是不是雖然我的最強點,所以可能有一些佈局問題;)

我希望可以幫助一些。

0

對卡爾斯的答案稍微有些迴應。

您也可以使用此解決方案。

<style> 
    div#scrollable { 
    overflow:auto; 
    height:###; 
    width:###; 
    } 
</style> 


<div id="scrollable"> 
    Your divs inside here 
</div> 
+0

這應該工作整齊,甚至更短:) – 2011-12-21 09:57:55

1

這將是你的HTML:

<div id="main_div"> 
    <div id="header"> 
     <div id="a" class="placeholder"></div> 
     <div id="b" class="placeholder"></div> 
    </div> 
    <div id="c" class="placeholder"></div> 
</div> 

這是你在你的CSS需要什麼:

#main_div { 
    width:1000px; /* you can change this */ 
    height:600px; /* you can change this */ 
    overflow:hidden; 
    overflow-y:hidden; 
    overflow-x:hidden; 
} 

#a { 
    float:left; 
    width:50% 
} 

#b { 
    float:right; 
    width:50% 
} 

#c { 
    clear:both; 
    width:100% 
} 

.placeholder { 
    height:300px; 
    max-height: 300px; /* you can change this */ 
    overflow:scroll; 
    overflow-y:hidden; 
}