Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Mar 2013
    Posts
    14
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Have a problem with my footer.

    Hello I have a problem with my footer. I want it to be under the div content all the time but now It's in the middle of the div content. I have try to solve this for 3 hours now. But no good results.

    How did I notice this bug? Well I made alot of hello<br> in content. And the footer get stuck it's not float down.

    Style.css
    PHP Code:
    #logo {
    leftauto;
    rightauto;
    text-aligncenter;
    }

    #menu {
    height26px;
    background-color#1F1A1A;
    background : -webkit-gradient(linearleft topleft bottombackground-color222);
    background : -moz-linear-gradient(topbackground-color222);
    border-top2px solid #999999;
    colorwhite;
    font-size18px;
    font-familyCooper Std;
    word-spacing:1px;
    width100%;
    positionabsolute;
    }

    #senastew {
    background-color#332D2D;
    min-height200px;
    width248px;
    top123px;
    positionabsolute;
    }

    #trailerw {
    background-color#332D2D;
    min-height200px;
    width248px;
    top123px;
    right0;
    positionabsolute;
    }

    #content {
    min-height300px;
    width62%;
    left259px;
    top123px;
    text-aligncenter;
    background-color#F6F1F1;
    positionabsolute;
    }

    #footer {
    bottomauto;
    text-aligncenter;
    right0;
    left0;
    positionabsolute;
    }

    a:link {color:black;}      /* unvisited link */
    a:visited {color:black;}  /* visited link */
    a:hover {color:black;}  /* mouse over link */
    a:active {color:black;}  /* selected link */ 

    a:link {text-decoration:none;}
    a:visited {text-decoration:none;}
    a:hover {text-decoration:none;}
    a:active {text-decoration:none;} 
    index.php
    PHP Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <head>
    <link href="style files/style.css" rel="stylesheet" type="text/css">
    </head>
    <html>
    <div id="logo">
    <font size="7" face="Cooper Std">Filmbladet.se</font><br>
    <font size="5" face="Myriad Pro">Senaste nyheterna inom film.</font><br>
    </div>

    <div id="menu">
    &nbsp;&nbsp;<a href="?p=filmer"><font color="white">Filmer</font></a> |
    <a href="?p=tv"><font color="white">Tv</font></a> |
    <a href="?p=kandisar"><font color="white">Kändisar</font></a> |
    <a href="?p=pag"><font color="white">På G</font></a> |
    <a href="?p=ft"><font color="white">Filmtipset</font></a> |
    <a href="?p=investera"><font color="white">Investera i Filmprojekt</font></a> |
    <a href="?p=an"><font color="white">Jobbannonser</font></a> |
    <a href="?p=ks"><font color="white">Köp/Sälj</font></a> |
    <a href="?p=mf"><font color="white">Manus Feedback</font></a>
    </div>

    <div id="senastew">
    <center><font size="4" face="Cooper Std" color="white"><u>Senaste</u></font>
    </center>
    </div>

    <div id="trailerw">
    <center><font size="4" face="Cooper Std" color="white"><u>Trailers</u></font><br><br>
    </center>
    </div>

    <div id="content">
    <?php
    switch($_GET['p']) {

    case 
    'filmer';
    $topic ' Filmer';
    include 
    'scripts files/filmer.php';
    break;

    case 
    'tv';
    $topic ' Tv';
    include 
    'scripts files/tv.php';
    break;

    case 
    'kandisar';
    $topic ' Kändisar';
    include 
    'scripts files/kandisar.php';
    break;

    case 
    'pag';
    $topic ' På G';
    include 
    'scripts files/pag.php';
    break;

    case 
    'ft';
    $topic ' Filmtipset';
    include 
    'scripts files/ft.php';
    break;

    case 
    'investera';
    $topic ' Investera';
    include 
    'scripts files/investera.php';
    break;

    case 
    'kontakt';
    $topic ' Kontakt';
    include 
    'scripts files/kontakt.php';
    break;

    case 
    'addnews';
    $topic ' Lägg till nyhet';
    include 
    'scripts files/addnews.php';
    break;

    case 
    'to';
    $topic ' Tipsa oss';
    include 
    'scripts files/to.php';
    break;

    default;
    $topic ' Filmer';
    include 
    'scripts files/filmer.php';
    break;

    }
    ?>
    </div>

    <div id="footer"><center>
    <a href="?p=kontakt">Kontakta oss </a> | <a href="?p=donera">Donera </a> | <a href="?p=to">Tipsa oss</a><br>
    <p>Copyrights Filmbladet - All rights reserved. 2013.</p></center>
    </div>
    </html>

    <head>
    <title><?php echo"Filmbladet -"; echo $topic?></title>
    </head>
    Last edited by slexus; 05-07-2013 at 07:18 PM.

  • #2
    New Coder
    Join Date
    Apr 2013
    Posts
    38
    Thanks
    1
    Thanked 3 Times in 3 Posts

    Solution : Placing a full width footer under floating divs

    Code:
    html, body 
    { 
        height: 100%; 
    } 
    
    #divHeader
    {
        height: 100px;
    }
    
    #divContent
    {
        min-height: 100%; 
        height: auto !important; /*Cause footer to stick to bottom in IE 6*/
        height: 100%; 
        margin: 0 auto -100px; /*Allow for footer height*/
        vertical-align:bottom;
    }
    
    #divFooter, #divPush
    {
        height: 100px; /*Push must be same height as Footer */
    }
    
    <div id="divContent">
        <div id="divHeader">
            Header
        </div>
    
        Content Text
    
        <div id="divPush"></div>
    </div>
    <div id="divFooter">
        Footer
    </div>

  • #3
    New Coder
    Join Date
    Mar 2013
    Posts
    14
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Already fixed. Thanks anyway!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •