1

I want to fix the footer at the bottom of screen like if the screen height is increase or decrease it comes on the bottom of screen, it never be come shorter then screen height?

HTML

<div class="footer">

<p> <a href="../info/about.php">About </a><a href="../info/help.php">Help </a><a href="../info/terms.php">Terms </a><a href="../info/privacy.php">Privacy </a><a href="../info/advertise.php">Advertise</a><a> - </a>@2016 webste</p>

    </div>

CSS

.footer {
background-color:#fafafa;
 text-align: center;
 height:30px;
 margin-top:10%;
}

.footer p {
color: #3c4a50;
line-height: 25px;
    font-size: 13.3333px;
    font-family: Arial;
}

.footer a {
color: #3c4a50;
text-decoration: none;
    font-size: 13.3333px;
    line-height: normal;
    padding-right:0.5%;
}

.footer a:hover {
color: #252d31;
font-size:95%;
}
Nakhhhh
  • 305
  • 1
  • 4
  • 14

4 Answers4

4

add this css

.footer {
    position: fixed;
    bottom: 0;
}
Kiran Shinde
  • 5,732
  • 4
  • 24
  • 41
0

Did you try :

.footer {
 background-color:#fafafa;
 text-align: center;
 height:30px;
 position:fixed;
 bottom:0;
 left:0;
 width:100%;
}
0

JS fiddle link -

https://jsfiddle.net/e1oywpov/

Just add, position: fixed and bottom:0px, then it will remain in the bottom

.footer {
background-color:#fafafa;
 text-align: center;
height:30px;
margin-top:10%;
bottom:0px;
position:fixed
}
Ayush Sharma
  • 2,057
  • 15
  • 25
0

you can add following CSS & add z-index also

.footer {
    position: fixed;
    z-index: 1;
    bottom: 0;
}
Jagajit Prusty
  • 2,070
  • 2
  • 21
  • 39