html - Unknown div adding length to page if page is shorter than window -
i trying put sticky footer on site. not "sticks bottom of window no matter how scroll" stickyfooter, "no matter how long page, footer go @ bottom of window, provided scroll way down" sticky footer.
i have tried implementing 4-5 different versions around web, have run problem:
every time have page less than height of user's browser, page add in around 100px after content, before footer, , see page, big blank space, , if scroll down, footer.
here page having problem: https://elcheapohost.com/contact
so here shortened version of code:
<head>...snip...</head> <div id="wrap">content here</div> </div><!-- /wrap--><div id="foot"> <footer> <div class=" copyright">© copyright <?php echo date('y'); ?> <a href="http://www.joshuapedroza.com">joshua pedroza</a>. rights reserved. <a href="/tos">terms of service</a>.</div> </footer><!-- end footer --></div> <!-- /foot -->
and css:
html, body { height:100%;/* needed base 100% height on known*/ } #wrap { margin:auto; min-height:100%; padding-top:-48px;/*footer height - drags outer 40px through top of monitor */ } * html #wrap { height:100% } #foot {/* footer sits @ bottom of window*/ padding-top: 35px; margin:auto; height:48px;/* must match negative margin of #wrap */ clear:both; } /*opera fix*/ body:before {/* maleika (kohoutec)*/ content:""; height:100%; width:0; margin-top:-32767px;/* thank erik j - negate effect of float*/ } #wrap:after {/* thank erik j - instead of using display table ie8*/ clear:both; display:block; height:1%; content:" "; }
i not sure if twitter bootstrap issue, since have had issues same bug in past. has else encountered it?
example of page: content longer: http://gyazo.com/a03348451474ad62e3250273cfe474de content shorter: http://gyazo.com/8221af4593dd58f98cedebd5670e4e8a (no matter how short page is, add in scroll bar)
remove
padding-top:35px
from /#foot
in stick_footer.css
and
margin-top:35px
from footer
in styles.css
there no longer space between footer , bottom of content. if not answer let me know , can dig little deeper.
Comments
Post a Comment