Trying to Get Footer at Bottom of Page

Discussion in 'Web Design and Development' started by zechmann, Apr 7, 2008.

  1. macrumors member

    Joined:
    May 8, 2007
    #1
  2. macrumors 68000

    Me1000

    Joined:
    Jul 15, 2006
    #2
    just by copying what was given this worked,

    Code:
    <html>
    <head>
    	<style type="text/css">
    	html
    {
    height: 100%;
    }
    
    body
    {
    height: 100%;
    }
    
    #nonFooter
    {
    position: relative;
    min-height: 100%;
    }
    
    * html #nonFooter
    {
    height: 100%;
    }
    
    #content
    {
    padding-bottom: 9em;
    }
    
    #footer
    {
    position: relative;
    margin-top: -7.5em;
    } 
    	</style>
    </head>
    <body>
    <div id="nonFooter">
    <div id="content">
    </div>
    </div>
    <div id="footer">daasfdaf
    </div>
    </body>
    </html> 
    
     
  3. macrumors G4

    Eraserhead

    Joined:
    Nov 3, 2005
    Location:
    UK
    #3
    ^^ You really should put the CSS in a different file from the HTML ;).
     
  4. thread starter macrumors member

    Joined:
    May 8, 2007
    #4
    all it done is give me errors: your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
    XML error message: Content is not allowed in trailing section.

    i pasted it at the top, where do you paste it...
     
  5. macrumors G4

    Eraserhead

    Joined:
    Nov 3, 2005
    Location:
    UK
    #5
    The CSS should be in an external stylesheet (called mainstyle.css for example) . With a link to it in the head of the html.

    e.g.

    Code:
    <html>
    	<head>
    		<link rel="stylesheet" type="text/css" href="mainstyle.css">
    		<!--Other head content-->
    	</head>
    	<body>
    		<!-- body content-->
    	</body>
    </html>
    
     
  6. thread starter macrumors member

    Joined:
    May 8, 2007
  7. macrumors 6502a

    lancestraz

    Joined:
    Nov 27, 2005
    Location:
    RI
    #7
    Maybe this will help.
    I think you just have to copy your CSS code directly above the tag "]]></b:skin>". Whatever that means.
     
  8. thread starter macrumors member

    Joined:
    May 8, 2007
    #8
    tried it, didn't work... i think i am just over my head with the coding... hopefully someone will understand it :D
     
  9. macrumors member

    Joined:
    Apr 7, 2008
    #9
    Set your footer to clear: both, and it should be at the bottom.
     
  10. macrumors G4

    Eraserhead

    Joined:
    Nov 3, 2005
    Location:
    UK
    #10
    @OP are you using float in your design?

    OK, ignore that then.
     

Share This Page