布局结构
*******************head**************************
**************************************************
*
Left * right
**************************************
****************foot******************
(图)
要求: Left,right,foot的高度随着浏览器大小改变与改变,foot总在下面,
代码: div+css+js实现
<%@ Page Language="C#" AutoEventWireup="true" Theme="SkinDefault" CodeFile="副本 memberQuery.aspx.cs" Inherits="Application_memberQuery" %>
<!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 id="Head1" runat="server">
<title>无标题页</title>
</head>
<script>
function OnWindowsReSize()
{
document.getElementById('PageSideleft').style.height = document.body.clientHeight - 20 - 2;
document.getElementById('PageSideRight').style.height = document.body.clientHeight - 20 - 2;
document.getElementById('PageSideRight').style.width = document.body.clientWidth - 154 - 2;
document.getElementById('PageSideRight').style.left = '154px';
document.getElementById('PageRight_Head').style.width = document.body.clientWidth - 154 - 2;
document.getElementById('PageRight_Center').style.width = document.body.clientWidth - 154 - 2;
document.getElementById('PageRight_Center').style.height = document.body.clientHeight - 20 - 2 - 22 - 2 - 22 - 2;
}
</script>
<body bottommargin="0" leftmargin="0" rightmargin="0" topmargin="0" style="width: 100%; height: 100%;" οnlοad="OnWindowsReSize()" οnresize="OnWindowsReSize()">
<form id="form1" runat="server">
<div id="PageHead"> </div>
<div id="PageSideLeft">
<div id="PageLeft_Head"> </div>
<div id="PageLeft_Center"> </div>
</div>
<div id="PageSideRight">
<div id="PageRight_Head"> </div>
<div id="PageRight_Center"> </div>
<div id="PageRight_Foot"> </div>
</div>
</form>
</body>
</html>
css:
body
{
font-size: 9pt;
}
#PageHead
{
width: 100%;
background-image: url(../../Application/images/title.jpg);
color: #ffffff;
height: 20px;
position: absolute;
top: 0;
}
#PageSideLeft
{
padding-bottom: 0;
margin-bottom: 0;
position: absolute;
top: 20px;
width: 150px;
border-right: lightsteelblue 1px solid;
border-top: lightsteelblue 1px solid;
border-left: lightsteelblue 1px solid;
border-bottom: lightsteelblue 1px solid;
}
#PageSideRight
{
padding-bottom: 0;
margin-bottom: 0;
position: absolute;
top: 20px;
border-right: lightsteelblue 1px solid;
border-top: lightsteelblue 1px solid;
border-left: lightsteelblue 1px solid;
border-bottom: lightsteelblue 1px solid;
}
#PageRight_Head
{
height: 22px;
border-bottom: lightsteelblue 1px solid;
vertical-align: baseline;
text-align: left;
background-color: lavender;
}
#PageRight_Head input
{
border-right: gainsboro 1px solid;
background-position: 0% 50%;
border-top: gainsboro 1px solid;
font-size: 9pt;
background-attachment: scroll;
border-left: gainsboro 1px solid;
color: #000000;
border-bottom: gainsboro 1px solid;
background-repeat: repeat;
height: 16px;
background-color:expression((this.readOnly && this.readOnly==true)?"GhostWhite":"")
}
#PageLeft_Head
{
height: 22px;
border-bottom: lightsteelblue 1px solid;
vertical-align: middle;
text-align: center;
background-color: lavender;
}
#PageRight_Center
{
border-bottom: lightsteelblue 1px solid;
background-color: ghostwhite;
}
#PageLeft_Center
{
vertical-align: top;
text-align: left;
}
#PageRight_Foot
{
height: 20px;
vertical-align: baseline;
text-align: right;
background-color: lavender;
}