我希望我的表格或 div 覆盖 100% 的用户屏幕,但 height"100%" 不起作用。我正在尝试使用 jQuery 来获取屏幕尺寸,我可以这样做,但是如何将它放在表格高度代码中?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>For The Holy Church</title>
<style type="text/css">
body {
background-image: url(images/BG.jpg);
background-repeat: repeat;
background-color: #181818;
margin: 0px;
height: 100%;
}
#Main {
background-image: url(images/HolyBG.jpg);
background-repeat: repeat-y;
background-position: center top;
height: 100%;
}
</style>
</head>
<body>
<table width="100%" height="100%" border="3" cellpadding="0" cellspacing="0" id="Main">
<tr>
<td valign="top"><table width="100%" height="100px" border="0" cellpadding="0" cellspacing="0" background="images/TopBG.jpg">
<tr>
<td> </td>
</tr>
</table>
<table width="100%" height="350px" border="0" cellpadding="0" cellspacing="0" background="images/VaticanBG.jpg">
<tr>
<td><table width="100" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/banner/01.jpg" alt="" width="933" height="350" /></td>
</tr>
</table></td>
</tr>
</table>
<pre><script>$(document).ready(function() {
$("p").text(screen.height);
});
</script>
<br />
</pre>
<p> </p>
<p> </p></td>
</tr>
</table>
</body>
</html>
我的问题是表格只到内容而不是屏幕高度。