我试过这样做,但它似乎只是被忽略。我发现一些文章说,如果你想这样做,那么你必须确保父对象也是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