Thursday 28 August 2014

Footer Fixed at bottom possible without jQuery

Footer fixed bottom position

I have a page with only a couple of lines of content. I want the footer to be pushed to the bottom.

<div id="footer"></div>

I don't want to use #footer{ position:fixed;bottom:0; } AKA Sticky Footer

Is this possible without jQuery?

ThaX for REf link:    http://stackoverflow.com/questions/16679146/force-footer-on-bottom-on-pages-with-little-content
<html>
    <head>
        <link rel="stylesheet" href="layout.css" ... />
    </head>
    <body>
        <div class="wrapper">
            <p>Your website content here.</p>
            <div class="push"></div>
        </div>
        <div class="footer">
            <p>Copyright (c) 2008</p>
        </div>
    </body>
<style>

* {
margin: 0;
}
html, body {
height: 100%;
}
.wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -4em;
}
.footer, .push {
height: 4em;
}
</style>
</html>

No comments:

Post a Comment