vs2008下面新建一个标准页面, 代码如下 页面里里面只简单包含一个div,我想让div高度为100%,在网上找了半天,讲是设置html,body 为100% 就可以了,可是我测试了半天就是不行,哪位大侠,帮帮忙?谢谢了
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="GPSV2.WebForm1" %>
<!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" height="100%" >
<head runat="server">
<title></title>
<link href="../Styles/dntmanager.css" rel="stylesheet" type="text/css" />
<style type="text/css">
html,body{
margin:0px;
height:100%;
}
#deman{
height:100%;
background-color:#CCF;
}
</style>
</head>
<body style="height:100%;overflow:auto">
<form id="form1" runat="server">
<div class="ManagerForm" style="border-color:Red; BORDER-BOTTOM: #c8dcff 1px solid;
BORDER-LEFT: #c8dcff 1px solid;
BORDER-TOP: #c8dcff 1px solid;
BORDER-RIGHT: #c8dcff 1px solid;
height:auto !important;
height:100%;
">
ddddd</div>
</form>
</body>
</html>
<style type="text/css">
html,body{height:100%;}
.divTest{height:100%;}
</style>
<div class="divTest"></div>
直接设置<div style="border:1 solid red; height:100%"></div>;没有问题