Link to home
Start Free TrialLog in
Avatar of day6
day6Flag for United States of America

asked on

Sticky Footer Gap below ???

After experimenting with like a dozen methods of creating a sticky footer, I finally found the CSS combination which makes it actually do what a sticky footer should do. It moves to the bottom of the content if the viewport is full of content and stays at the bottom of browser viewport when the content is too short to fill up the viewport.

So I'm happy with that, but now I have this annoying 7-10px gap at the bottom of the footer that I can't seem to get rid of.  It doesn't matter which browser I view it in.

I've attached a pic of the issue as well as my primary CSS file which addresses the DIV arrangements.

@charset "utf-8";
/* CSS Document */
html, body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color:#411821;
	max-height:100%;
}
#bgimg {
	width: 100%;
	height: auto;
	left: 0px;
	top: 0px;
	z-index:1;
	/* this tells the bkg layer to allow divs overlaid */
	position:relative;
	background-color: #bd8240;
}
#hdrtitle {
	width: 100%;
	height: auto;
	top: 15px;
	z-index:2;
	/* this tells the bkg layer to allow divs overlaid */
position:absolute;
}
.navmnu {
z-index:100;
postion:absolute;
bottom:10%;
left:30%;
}
img.bg {
	width: 100%;
	}
img.but {
	width:90%;
	height:auto;
	border-radius:15px;
	border:white 7px solid;
	}
img.side {
	width:100%;
	height:auto;
	border:black 1px solid;
}
.wrap {
	position:relative;
	margin:0 auto;
    width:100%;
	display:block;
	min-height:100%;
}

#header {
	width:100%;
	float:left;
	margin-top:70px;
	background-image:url(../../images/hdrmnubkg.png);
}
/* when using the STICKY FOOTER make sure it is OUTSIDE the container DIV and has a zero margin */
#footer {
	position:relative;
	margin:0 auto;
	height:85px;
	border-top:medium solid #bd8240;
	background-color:#bababa;
	width:100%;
	clear:both;
}

#hdrmnu {
margin-top :-20px\9; /* IE8 and below */
border-bottom: #2d1810 thick solid;
}

Open in new window

gapfooter.jpg
Avatar of EMB01
EMB01
Flag of United States of America image

Do you have a live version?  I can play with the code in firebug and get it to work for you.
Avatar of day6

ASKER

ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of day6

ASKER

@julianH

If you notice my CSS above, the footer is 85px. I don't know what you mean? Plus, the gap is below the DIV itself, not within the DIV. The table is only as high as the div it's contained in.
Avatar of day6

ASKER

Nevermind, you're right. The cell spacing in the table forced it outside the footer height parameters. I increased it to 90px height in the CSS and it solved it. Thank you.
you are welcome