2010-07-19 62 views
1

我怎樣才能達到相當於:WPF樣佈局HTML5/CSS3

<Grid> 
<Grid.RowDefinitions> 
    <RowDefinition Height="300"> 
    <RowDefinition Height="*"> 
    <RowDefinition Height="100"> 

磨片隨高度的行*罷了,頂部和底部行後的剩餘屏幕空間已經採取了400像素?

感謝

回答

0

您可以通過使用DIV(S)

​​

和CSS實現這一點:

.upperSection 
{ 
    position:absolute; 
    top:0; 
    left:0; 
    height:300px; 
    width:100%; 
} 

.content 
{ 
    position:absolute; 
    top:300px; 
    left:0; 
    height:100%; 
    width:100%; 
} 

.lowerSection 
{ 
    position:absolute; 
bottom:0; 
left:0; 
height:100px; 
width:100%; 

} 
+0

謝謝,但這是行不通的。內容框的高度與屏幕高度相同。不是上下之間的差異。這是否意味着你需要JavaScript來實現這一目標? – ConfusedNoob 2010-07-21 07:38:20

0

這應該可以解決這個問題:

.upperSection 
{  
    top:0; 
    left:0; 
    height:300px; 
    width:100%; 

} 

.content 
{ 
    position:absolute; 
    left:0; 
    top:300px; 
    bottom:100px; 
    width:100%; 



} 

.lowerSection 
{ 
position:absolute; 
bottom:0; 
left:0; 
height:100px; 
width:100%; 


} 

乾杯。