Hi, my footer is not where ist suppose to be, its suppose to be inside the container not out side and way below it....

image of what it looks like now:

Click Here

My code: style.css

/* begin css */

body  {
    font: 100% Verdana, Arial, Helvetica, sans-serif;
    background: #6393c1; /* Old browsers */
    /* IE9 SVG, needs conditional override of 'filter' to 'none' */
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6393c1', endColorstr='#cfe7fa',GradientType=1 ); /* IE6-8 fallback on horizontal gradient */
    margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
    padding: 25px;
    text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
    color: #000000;

    a:link {color:#000000;}      /* unvisited link */
    a:link {text-decoration:none;}    /* unvisited link */
    a:visited {color:#000000;}  /* visited link */
    a:hover {color:#000FFF;}  /* mouse over link */
    a:active {color:#0000FF;}  /* selected link */

/* Tips for Elastic layouts 
1. Since the elastic layouts overall sizing is based on the user's default fonts size, they are more unpredictable. Used correctly, they are also more accessible for those that need larger fonts size since the line length remains proportionate.
2. Sizing of divs in this layout are based on the 100% font size in the body element. If you decrease the text size overall by using a font-size: 80% on the body element or the #container, remember that the entire layout will downsize proportionately. You may want to increase the widths of the various divs to compensate for this.
3. If font sizing is changed in differing amounts on each div instead of on the overall design (ie: #sidebar1 is given a 70% font size and #mainContent is given an 85% font size), this will proportionately change each of the divs overall size. You may want to adjust based on your final font sizing.
.twoColElsLtHdr #container { 
    width: 46em;  /* this width will create a container that will fit in an 800px browser window if text is left at browser default font sizes */
    background: #FFFFFF;
    margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
    border: 1px solid #000000;
    text-align: left; /* this overrides the text-align: center on the body element. */
        height: 900px;

.twoColElsLtHdr #header {
    background: #DDDDDD; 
    padding: 0 10px;  /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */
    border-bottom: 1px solid #000;
.twoColElsLtHdr #header h1 {
    margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
    padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */

/* Tips for sidebar1:
1. Be aware that if you set a font-size value on this div, the overall width of the div will be adjusted accordingly.
2. Since we are working in ems, it's best not to use padding on the sidebar itself. It will be added to the width for standards compliant browsers creating an unknown actual width. 
3. Space between the side of the div and the elements within it can be created by placing a left and right margin on those elements as seen in the ".twoColElsLtHdr #sidebar1 p" rule.
.twoColElsLtHdr #sidebar1 {
    float: left;
    border-right: 1px dashed #000; 
    width: 185px; /* since this element is floated, a width must be given */
    background: #90bade; /* the background color will be displayed for the length of the content in the column, but no further */
    padding: 0 0; /* top and bottom padding create visual space within this div */
        height: 75%;
.twoColElsLtHdr #sidebar1 h3, .twoColElsLtHdr #sidebar1 p {
    margin-left: 10px; /* the left and right margin should be given to every element that will be placed in the side columns */
    margin-right: 10px;

/* Tips for mainContent:
1. If you give this #mainContent div a font-size value different than the #sidebar1 div, the margins of the #mainContent div will be based on its font-size and the width of the #sidebar1 div will be based on its font-size. You may wish to adjust the values of these divs.
2. The space between the mainContent and sidebar1 is created with the left margin on the mainContent div.  No matter how much content the sidebar1 div contains, the column space will remain. You can remove this left margin if you want the #mainContent div's text to fill the #sidebar1 space when the content in #sidebar1 ends.
3. To avoid float drop, you may need to test to determine the approximate maximum image/element size since this layout is based on the user's font sizing combined with the values you set. However, if the user has their browser font size set lower than normal, less space will be available in the #mainContent div than you may see on testing.
4. In the Internet Explorer Conditional Comment below, the zoom property is used to give the mainContent "hasLayout." This avoids several IE-specific bugs that may occur.
.twoColElsLtHdr #mainContent {
    margin: 0 1.5em 0 13em; /* the right margin can be given in ems or pixels. It creates the space down the right side of the page. */ 
    border-left: 0px dashed #000000;
    padding-left: 20px;
.twoColElsLtHdr #footer { 
        padding: 0 0;  /*this padding matches the left alignment of the elements in the divs that appear above it. */
    background:#DDDDDD;    /* */
        border: 1px solid #000;
    /*border-bottom: 1px solid #000;*/
    /*border-top: 1px solid #000;*/
        /*border-right: 1px solid #000;*/
        /*border-left: 1px solid #000;*/
.twoColElsLtHdr #footer p {
    margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
    padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
    text-align: center;

/* Miscellaneous classes for reuse */
.fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
    float: right;
    margin-left: 8px;
.fltlft { /* this class can be used to float an element left in your page */
    float: left;
    margin-right: 8px;
.clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
    font-size: 1px;
    line-height: 0px;

<!--[if IE]>
<style type="text/css"> 
/* place css fixes for all versions of IE in this conditional comment */
.twoColElsLtHdr #sidebar1 { padding-top: 30px; }
.twoColElsLtHdr #mainContent { zoom: 1; padding-top: 15px;}

/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
/* end css */

My index page:

<!--- begin index -->

 <!DOCTYPE html>

<!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">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Fort Belknap Vocational Rehabilitation Program</title>
<link rel="stylesheet" href="style.css" media="screen" />

<style type="text/css">

border: 0px solid black;
border-bottom-width: ;
width: 169px;

#ddblueblockmenu ul{
margin: 0;
padding: 0;
list-style-type: none;
font: normal 90% 'Trebuchet MS', 'Lucida Grande', Arial, sans-serif;

#ddblueblockmenu li a{
display: block;
padding: 3px 0;
padding-left: 9px;
width: 169px; /*185px minus all left/right paddings and margins*/
text-decoration: none;
color: white;
background-color: #2175bc;
border-bottom: 1px solid #90bade;
border-left: 7px solid #1958b7;

* html #ddblueblockmenu li a{ /*IE only */
width: 169px; /*IE 5*/
w/idth: 169px; /*185px minus all left/right paddings and margins*/

#ddblueblockmenu li a:hover {
background-color: #2586d7;
border-left-color: #1c64d1;

#ddblueblockmenu div.menutitle{
color: white;
border-bottom: 1px solid black;
padding: 1px 0;
padding-left: 7px;
background-color: #4B4A4A;
font: bold 90% 'Trebuchet MS', 'Lucida Grande', Arial, sans-serif;
width: 178px;



<body class="twoColElsLtHdr">

<div id="container" style="width: 862px; height: 829px">
  <div id="header">
    <img  alt="pic" src="images/logo2.png" />
  <!-- end #header --></div>

  <div id="sidebar1">

    <div id="ddblueblockmenu" style="width: 187px; height: 699px">
    <div class="menutitle">Navigation</div>
                        <li><a href="index.html">Home</a></li>
                        <li><a href="eligibility.html">Eligibility</a></li>
                        <li><a href="services.html">Services</a></li>
                        <li><a href="specpost.html">Specific Post-Employment Services</a></li>
                        <li><a href="successstories.html">Success Stories</a></li>
                        <li><a href="pandp.html">Application and Policies/Procedures</a></li>

    <div class="menutitle">Links</div>
                        <li><a href="http://www.socialsecurity.gov/">Social Security</a></li>
                        <li><a href="http://www.dphhs.mt.gov/vocrehab/index.shtml">Montana Vocational Rehab Services</a></li>


    <div class="menutitle"></div>

  <div id="mainContent">
    <iframe name="I1" src="index3.htm" height="700px" width="500px" border="0" frameborder="0">
    Your browser does not support inline frames or is currently configured not to display inline frames.
    <!-- end #mainContent -->


    <div id="footer">
        <p>| COPYRIGHT © 2011 - 2012 | CSS Layout | ALL RIGHTS RESERVED |</p>
        <!-- end #footer -->
<!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats -->
<br class="clearfloat" />
<!-- end #container -->
</div><br class="clearfloat" />
<!-- end index -->

Recommended Answers

All 3 Replies

Looks like the additional "clearfloat" try removing the class from line 236

Although reading the comment it should be inserted to line 230

commented: thanks +0

removed all clear floats the gap is still there, its wierdest thing i ever saw...

just dump the code into a test page. It's your iFrame height that is pushing everything south

<iframe name="I1" src="index3.htm" height="700px" width="500px" border="0" frameborder="0">
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.