我試過這樣做,但它似乎只是被忽略。我發現一些文章說,如果你想這樣做,那麼你必須確保父對象也是100%。我有以下內容:HTML設置表的高度爲100%
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server" style="height:100%">
<title>Untitled Page</title>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
<style type="text/css">
.MasterStyle
{
width: 98%;
height: 100%;
}
.ContentStyle
{
width: 100%;
}
.TableStyle
{
width: 133px;
height: 100%;
}
</style>
</head>
<body class="MasterStyle">
<form id="frmMaster" runat="server">
<div class="ContentStyle">
<asp:Label runat="server" Text="My Site Name" Font-Bold="true" Font-Names="MS-Sans"
Style="text-align:right" Width="100%" />
<br />
</div>
<hr />
<table style="width:100%; height:100%" border="true">
<tr>
<td class="TableStyle" style="height:100%">
我在桌子周圍有一個邊框,可以看到它沒有填充高度。誰能告訴我爲什麼我沒有獲得100%的身高?
謝謝。設置表單和HTML工作。但是,我收到一個編譯警告,說沒有HTML的樣式屬性! – 2010-08-23 07:24:53