2 Replies - 723 Views - Last Post: 15 May 2012 - 06:11 AM

#1 ninechances  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 188
  • Joined: 08-February 10

Footer Not Sticking to Bottom of Page

Posted 14 May 2012 - 03:33 PM

I can't figure out why my footer isn't sticking. Here is the CSS & HTML

CSS:

body {
		margin:0 auto -4em;
		padding:0;
		border:0;			/* This removes the border around the viewport in old versions of IE */
		width:100%;
		background:#343434;
		min-width:600px;		/* Minimum width of layout - remove line if not required */
						/* The min-width property does not work in old versions of Internet Explorer */
		font-size:90%;
		font-family:Arial, Helvetica, sans-serif;
	}
	a {
		color:#666;
	}
	a:hover {
		color:#06C;
	}
	h1, h2, h3 {
		margin:.8em 0 .2em 0;
		padding:0;
	}
	p {
		margin:.4em 0 .8em 0;
		padding:0;
		font-family:Arial, Helvetica, sans-serif;
		font-size:12px;
	}
	img {
		margin:10px 0 5px;
	}
	/* Header styles */
	#header {
		clear:both;
		float:left;
		width:100%;
	}
	#header {
		border-bottom:1px solid #000;
	}
	#header p,
	#header h1,
	#header h2 {
		padding:.4em 15px 0 15px;
		margin:0;
	}
	#header img {
		margin-left: 15px;
	}
	#header ul {
		clear:left;
		float:left;
		width:100%;
		list-style:none;
		margin:10px 0 0 0;
		padding:0;
	}
	#header ul li {
		display:inline;
		list-style:none;
		margin:0;
		padding:0;
	}
	#header ul li a {
		font-size:11px;
		display:block;
		float:left;
		margin:0 0 0 1px;
		padding:3px 10px;
		text-align:center;
		background:#eee;
		color:#000;
		text-decoration:none;
		position:relative;
		left:15px;
		line-height:1.3em;
		text-transform:uppercase;
	}
	#header ul li a:hover {
		background:#06C;
		color:#fff;
		text-transform:uppercase;
	}
	#header ul li a.active,
	#header ul li a.active:hover {
		color:#fff;
		background:#000;
		text-transform:uppercase;
	}
	#header ul li a span {
		display:block;
	}
	/* 'widths' sub menu */
	#layoutdims {
		clear:both;
		background:#eee;
		border-top:4px solid #000;
		margin:0;
		padding:6px 15px !important;
		text-align:right;
	}
	/* column container */
	.colmask {
		position:relative;	/* This fixes the IE7 overflow hidden bug */
		clear:both;
		float:left;
		width:100%;			/* width of whole page */
		overflow:hidden;		/* This chops off any overhanging divs */
		margin: 0 auto -150px
	}
	/* common column settings */
	.colright,
	.colmid,
	.colleft {
		float:left;
		width:100%;
		position:relative;
	}
	.col1,
	.col2,
	.col3 {
		float:left;
		position:relative;
		padding:0 0 1em 0;
		overflow:hidden;
		height:100%;
	}
	/* Full page settings */
	.fullpage {
		background:#eee;		/* page background colour */
	}
	.fullpage .col1 {
		width:96%;		/* page width minus left and right padding */
		left:2%;			/* page left padding */
		right:2%;
	}

	/* Footer styles */
	#footer {
		clear:both;
		float:left;
		width:100%;
		border-top:1px solid #000;
		background-color:#343434;
		margin: 0 auto;
	}
	#footer p {
		padding:10px;
		margin:0;
		color:#FFF;
	}




HTML STRUCTURE:

<body>
        <div id="header">
	        <img src="" id="header img" />
	        <ul id="nav a">
		        <li></li>
		        <li></li>
                        <li></li>
	        </ul>
	        <p id="layoutdims"></p>
        </div><!-- end header -->

        <div class="colmask fullpage">
	    <div class="col1">
	    </div><!-- end col 1 -->

        <div id="footer">
	    <p></p>
        </div><!-- end footer -->
        </div><!-- end colmask -->

    </body>
</html>



Any help is appreciated. Thanks.

This post has been edited by ninechances: 14 May 2012 - 03:34 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Footer Not Sticking to Bottom of Page

#2 fromTheSprawl  Icon User is offline

  • Monomania
  • member icon

Reputation: 513
  • View blog
  • Posts: 2,063
  • Joined: 28-December 10

Re: Footer Not Sticking to Bottom of Page

Posted 14 May 2012 - 07:07 PM

Try adding this to your footer on your CSS:

clear:both;

Was This Post Helpful? 0
  • +
  • -

#3 exiles.prx  Icon User is offline

  • D.I.C Head

Reputation: 65
  • View blog
  • Posts: 241
  • Joined: 22-November 10

Re: Footer Not Sticking to Bottom of Page

Posted 15 May 2012 - 06:11 AM

If you mean "sticking" as in you can scroll the content but the footer is in view at the bottom at all times, then you need to use 'position: fixed' and 'bottom: 0'.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1