私のウェブサイトでブラウザの全高を利用したいと思います。私はすべての通常のcssを無駄にしようとしました。サイドバーやメイン コンテンツのようにブラウザの高さいっぱいに表示し、ヘッダーは固定の高さのままにする必要があります。
ダモに感謝します
HTML
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<script src="assets/js/jquery.js" type="text/javascript"></script>
<title>TestSite</title>
<link href="assets/css/Main.css" rel="stylesheet" type="text/css" />
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" LoadScriptsBeforeUI="True">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel" runat="server">
<ContentTemplate>
<div id="HeaderWrapper">
<div id="Header">
</div>
</div>
<div id="ContentWrapper">
<div id="Sidebar">
</div>
<div id="Content" style="border: thin solid #666666" class="Tabs">
</div>
<!-- end of content -->
</div>
<!-- end of wrapper -->
<div>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
</html>
CSS
#HeaderWrapper
{
width: 100%;
clear: both;
height: 80px;
margin-top:2px;
margin-bottom:2px;
margin-right:0px;
margin-left:0px;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFF', endColorstr='#99CCFF'); /* for IE */
background: -webkit-gradient(linear, left top, left bottom, from(#FFF), to(#9CF)); /* for webkit browsers */
background: -moz-linear-gradient(top, #FFF, #9CF); /* for firefox 3.6+ */
padding-top:0px;
padding-bottom:0px;
padding-right:0px;
padding-left:0px;
border-bottom:thin solid #FFFFFF;
}
#Header
{
width:1024px;
margin: 0 auto;
padding-top:0px;
padding-bottom:0px;
padding-right:0px;
padding-left:0px;
border-radius: 5px;
}
#ContentWrapper
{
width:1024px;
margin: 0 auto;
padding-top:0px;
padding-bottom:0px;
padding-right:0px;
padding-left:0px;
border-radius: 5px;
}
/* sidebar */
#Sidebar {
float: left;
width: 184px;
padding: 0px;
height:800px;
border: thin solid #666666;
padding:0px;
border-radius: 0px;
margin-top:0px;
margin-bottom:0px;
margin-right:6px;
margin-left:0px;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFF', endColorstr='#FFFFFF'); /* for IE */
background: -webkit-gradient(linear, left top, left bottom, from(#FFF), to(#FFF)); /* for webkit browsers */
background: -moz-linear-gradient(top, #FFF, #FFF); /* for firefox 3.6+ */
}
/* end of sidebar -->
/* content */
#Content {
float: left;
width: 824px;
padding-top:0px;
padding-bottom:0px;
padding-right:0px;
padding-left:0px;
min-height:800px;
border-radius: 0px;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFF', endColorstr='#FFFFFF'); /* for IE */
background: -webkit-gradient(linear, left top, left bottom, from(#FFF), to(#FFF)); /* for webkit browsers */
background: -moz-linear-gradient(top, #FFF, #FFF); /* for firefox 3.6+ */
}
/* End content */
/* End content */
html,body {
margin:0px;
padding:0px;
font-family: Arial, Helvetica, sans-serif;
font-size:13px;
line-height:1.5em;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#003366', endColorstr='#FFFFFF'); /* for IE */
background: -webkit-gradient(linear, left top, left bottom, from(#036), to(#FFF)); /* for webkit browsers */
background: -moz-linear-gradient(top, #036, #FFF); /* for firefox 3.6+ */
height: 100%;
}