FishMonger
10-12-2007, 06:02 AM
I'm reworking my email administration site to use div containers instead of iframes, but I'm not very skilled in css so I'm looking for some assistance in fixing the positioning.
It's a fairly basic setup. The main div container sets the height, width (scaled for 1024x768) and centers the page. The other 4 main div containers are the header, horizontal nav bar, main content, and footer which are all also centered and layered in that order.
The problem is with the positioning of the main content container and the footer and to prevent vertical scrolling of the main page container. The footer needs to be set at the absolute bottom and the height of the main content div needs to be fluid and adjust its size between the nav bar and footer without any spacing in-between. Currently, the main content container extends beyond the footer when viewed in FF and in both FF and II, the footer is past the end of the screen and required scrolling to view it.
How do I fix the css to force the footer to the bottom of the screen and instead of scrolling, the main content container would adjust its height accordingly.
html {height:100%;}
body {
margin: 0;
padding: 0;
height: 100%;
background-color: #cccccc;
font-family: arial, serif;
font-size: 9pt;
}
h1 {
position: relative;
margin: 0;
}
table {
margin: auto;
padding: 5px;
}
caption {
margin: auto;
padding: 5px;
color: #0000ff;
text-align: center;
font-size: 125%;
font-weight: bold;
}
td, th {
text-align: left;
padding-left: 5px;
padding-right: 5px;
}
#page_container {
position: relative;
width: 950px;
height: 100%;
margin: auto;
}
#header {
height: 130px;
padding: 10px;
text-align: center;
}
#nav_bar {
background-color: #eeeeee;
padding: 5px 0 5px;
text-align: center;
word-spacing: 10px;
font-weight: bold;
}
#content {
position: relative;
height: 100%;
padding-bottom: 150px;
overflow: auto;
}
* html #container {
height: 100%;
}
#footer {
position: absolute;
bottom: 0px;
height: 130px;
width: 100%;
background-color: #eeeeee;
text-align: center;
color: Red;
overflow: auto;
}
#header, #content {
background-color: white;
text-align: center;
}
#fatal {
border: thin solid grey;
float: right;
width: 35%;
padding: 10px;
}
#warning {
float: left;
width: 40%;
padding: 10px;
}
.left {
float: left;
margin-left: 10px;
}
.right {
float: right;
margin-right: 10px;
}
I'm using an html template, so this is the source of the rendered page. If it would help, I could also post the template source which will include additional details.
<!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" xml:lang="en" lang="en">
<head>
<title>Email Administration</title>
<meta http-equiv="Content-Type" content="text/html charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="/emadmin/admin.css" />
</head>
<body>
<div id="page_container">
<!-- begin header container -->
<div id="header">
<div class="left"><img src="/emadmin/left-logo.gif" alt="" /></div>
<div class="right"><img src="/emadmin/rt-logo.gif" alt="" /></div>
<div><img src="/emadmin/name.jpg" alt="" /></div>
<div><h1>Email Administration</h1></div>
<span class="left">emhttp101</span>
<span class="right"><a href="login.pl?Logout=Logout">Logout</a> rkb</span>
</div>
<!-- end header container -->
<!-- begin navigation bar -->
<div id="nav_bar">
<a href="search_v2.pl">Search</a>
<a href="modify_v2.pl">Modify</a>
<a href="delete_v2.pl">Delete</a>
<a href="passwd_v2.pl">ChgPassword</a>
</div>
<!-- end navigation bar -->
<!-- begin content container -->
<div id="content">
<h2>Search Address Book</h2>
<form method="post" action="search_v2.pl" enctype="multipart/form-data">
By:
<select name="searchfield">
<option value="email">Login ID</option>
<option value="lastname">Last Name</option>
<option value="firstname">First Name</option>
<option value="label">Description</option>
</select>
<input type="text" name="searchvalue" />
<input type="submit" name="locate" value="Locate User" />
</form>
<hr />
<!-- start of main contents i.e., results table from DB search -->
<!-- end of DB results -->
</div>
<!-- end content container -->
<!-- begin container to display error messages -->
<div id="footer">
</div>
<!-- end of error container -->
</div>
</body>
</html>
It's a fairly basic setup. The main div container sets the height, width (scaled for 1024x768) and centers the page. The other 4 main div containers are the header, horizontal nav bar, main content, and footer which are all also centered and layered in that order.
The problem is with the positioning of the main content container and the footer and to prevent vertical scrolling of the main page container. The footer needs to be set at the absolute bottom and the height of the main content div needs to be fluid and adjust its size between the nav bar and footer without any spacing in-between. Currently, the main content container extends beyond the footer when viewed in FF and in both FF and II, the footer is past the end of the screen and required scrolling to view it.
How do I fix the css to force the footer to the bottom of the screen and instead of scrolling, the main content container would adjust its height accordingly.
html {height:100%;}
body {
margin: 0;
padding: 0;
height: 100%;
background-color: #cccccc;
font-family: arial, serif;
font-size: 9pt;
}
h1 {
position: relative;
margin: 0;
}
table {
margin: auto;
padding: 5px;
}
caption {
margin: auto;
padding: 5px;
color: #0000ff;
text-align: center;
font-size: 125%;
font-weight: bold;
}
td, th {
text-align: left;
padding-left: 5px;
padding-right: 5px;
}
#page_container {
position: relative;
width: 950px;
height: 100%;
margin: auto;
}
#header {
height: 130px;
padding: 10px;
text-align: center;
}
#nav_bar {
background-color: #eeeeee;
padding: 5px 0 5px;
text-align: center;
word-spacing: 10px;
font-weight: bold;
}
#content {
position: relative;
height: 100%;
padding-bottom: 150px;
overflow: auto;
}
* html #container {
height: 100%;
}
#footer {
position: absolute;
bottom: 0px;
height: 130px;
width: 100%;
background-color: #eeeeee;
text-align: center;
color: Red;
overflow: auto;
}
#header, #content {
background-color: white;
text-align: center;
}
#fatal {
border: thin solid grey;
float: right;
width: 35%;
padding: 10px;
}
#warning {
float: left;
width: 40%;
padding: 10px;
}
.left {
float: left;
margin-left: 10px;
}
.right {
float: right;
margin-right: 10px;
}
I'm using an html template, so this is the source of the rendered page. If it would help, I could also post the template source which will include additional details.
<!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" xml:lang="en" lang="en">
<head>
<title>Email Administration</title>
<meta http-equiv="Content-Type" content="text/html charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="/emadmin/admin.css" />
</head>
<body>
<div id="page_container">
<!-- begin header container -->
<div id="header">
<div class="left"><img src="/emadmin/left-logo.gif" alt="" /></div>
<div class="right"><img src="/emadmin/rt-logo.gif" alt="" /></div>
<div><img src="/emadmin/name.jpg" alt="" /></div>
<div><h1>Email Administration</h1></div>
<span class="left">emhttp101</span>
<span class="right"><a href="login.pl?Logout=Logout">Logout</a> rkb</span>
</div>
<!-- end header container -->
<!-- begin navigation bar -->
<div id="nav_bar">
<a href="search_v2.pl">Search</a>
<a href="modify_v2.pl">Modify</a>
<a href="delete_v2.pl">Delete</a>
<a href="passwd_v2.pl">ChgPassword</a>
</div>
<!-- end navigation bar -->
<!-- begin content container -->
<div id="content">
<h2>Search Address Book</h2>
<form method="post" action="search_v2.pl" enctype="multipart/form-data">
By:
<select name="searchfield">
<option value="email">Login ID</option>
<option value="lastname">Last Name</option>
<option value="firstname">First Name</option>
<option value="label">Description</option>
</select>
<input type="text" name="searchvalue" />
<input type="submit" name="locate" value="Locate User" />
</form>
<hr />
<!-- start of main contents i.e., results table from DB search -->
<!-- end of DB results -->
</div>
<!-- end content container -->
<!-- begin container to display error messages -->
<div id="footer">
</div>
<!-- end of error container -->
</div>
</body>
</html>