html
2014-02-20 18 views 3 likes 
3

嘿傢伙,所以我想不出爲什麼尺寸沒有被改變,任何人都可以幫助我?我的理想目標是讓第一排是70%,第二排是30%。任何意見將不勝感激調整表的行百分比不起作用

<html> 
<body style="position:fixed; top:0px; left:0px;bottom:0px; right:0px; margin:0px;"> 
    <div style='display : table; width : 100%; height : 100%'> 

     <div style='display : table-row; width : 100%; height : 10%;'> 
      <div style="height:100%; width:100%; border:solid; display : table-cell;"> 
       blah 
      </div> 
     </div> 

     <div style='display : table-row; width : 100%; height : 50%;'> 
      <div style="height:100%; width:100%; border:solid; display : table-cell;"> 
       hah 
      </div> 
     </div> 

    </div> 
</body> 
</html> 
+1

你爲什麼不只是使用一個表呢? – witherwind

回答

1

試試這個代碼..

實例鏈接是在這裏:FIDDLE

HTML代碼

<html> 
<body style="position:fixed; top:0px; left:0px;bottom:0px; right:0px; margin:0px;"> 
    <div style='display : table; width : 100%; height : 100%'> 

     <div style='display : table-row; width : 100%; height : 70%;'> 
      <div style="height:70%; width:100%; border:solid; display : table-cell;"> 
       blah 
      </div> 
     </div> 

     <div style='display : table-row; width : 100%; height : 30%;'> 
      <div style="height:30%; width:100%; border:solid; display : table-cell;"> 
       hah 
      </div> 
     </div> 

    </div> 
</body> 
</html> 

希望這個代碼將會幫助你,此外,如果您有任何疑問,請讓我知道...

0

請嘗試以下。

<html> 
<body style="position:fixed; top:0px; left:0px;bottom:0px; right:0px; margin:0px;"> 
    <div style='display : table; width : 100%; height : 100%'> 

     <div style='display : table-row; width : 100%; height : 10%;'> 
      <div style="height:100%; width:70%; border:solid; display : table-cell;"> 
       blah 
      </div> 
     </div> 

     <div style='display : table-row; width : 100%; height : 50%;'> 
      <div style="height:100%; width:30%; border:solid; display : table-cell;"> 
       hah 
      </div> 
     </div> 

    </div> 
</body> 
</html> 

或低於一個

<html> 
<body style="position:fixed; top:0px; left:0px;bottom:0px; right:0px; margin:0px;"> 
    <div style='display : table; width : 100%; height : 100%'> 

     <div style='display : table-row; width : 70%; height : 10%;'> 
      <div style="height:100%; width:100%; border:solid; display : table-cell;"> 
       blah 
      </div> 
     </div> 

     <div style='display : table-row; width : 30%; height : 50%;'> 
      <div style="height:100%; width:100%; border:solid; display : table-cell;"> 
       hah 
      </div> 
     </div> 

    </div> 
</body> 
</html> 

快樂編碼

相關問題