0

I have a website where I need to have a common footer for all the pages. However the pages content varies and few pages have less body and few have scrollable body. But my footer doesn't stay the same for all the pages. I need it to be at the bottom for all the pages (after the body). I tried multiple ways using CSS, javascript, jquery but they work only for one page and not all together.

Could someone help me with this.

Sri
  • 573
  • 2
  • 6
  • 20

1 Answers1

0

I have struggled with this as well! I have learned that the key is to have a wrapper id:

html:

<html>

<body>
<div id="wrapper">


<div class="content">

<p> This is the content! </p>

</div> <!-- content -->



<footer>

<p> This is the footer!!! </p>

</footer>

<div> <!--#wrapper-->

</body>

</html>  

css:

html {
height:100%;
}


body {
height:100%; 
}

#wrapper{
min-height:100%;
position: relative;
}

footer{
position:absolute;
bottom:0px;
background-color: black;
color: white;
width:100%;
padding-top: 25px;
padding-bottom: 25px;
text-align:center;

}
Connor Meeks
  • 501
  • 1
  • 6
  • 19