2017-07-02 42 views
0

我正在使用Chrome,並且我正在嘗試製作選擇菜單。高度百分比變成圖片的高度而不是屏幕

(請不要判斷我使用表,我不想學習CSS)

http://jsfiddle.net/scottbeebiwan/FZB7C/44/

<table width="100%" height="100%" border="0"> 

    <tr> 

    <td colspan="2"> 
     <center> 
     <a href="signup.htm">Sign up<br /><img src="http://placehold.it/243x267" height="50%"></a> 
     </center> 
    </td> 

    </tr> 

    <tr> 

    <td> 
     <center> 
     <a href="download.htm">Download<br /><img src="http://placehold.it/243x267" width="50%"></a> 
     </center> 
    </td> 

    <td> 
     <center> 
     <a href="upload.php">Upload<br /><img src="http://placehold.it/243x267" width="50%"></a> 
     </center> 
    </td> 

    </tr> 

</table> 

如果縮小(或改變窗口的分辨率),該Sign Up圖像其餘圖像的大小保持不變。

回答

1

對於註冊元素,您將高度設置爲50%,而對於其他兩個,則設置寬度。您可能需要設置所有3個元素的高度。

+0

沒有幫助。 http://jsfiddle.net/FZB7C/46/ –

+0

似乎並非如此。您是否嘗試將HTML保存在html文件中並在瀏覽器中打開? – AnkitMittal

+0

不是。只是讓下半部分伸展。 –