css footer bottom of page code example
Example 1: how to get my footer to the bottom of the page using css
#page-container {
position: relative;
min-height: 100vh;
}
#content-wrap {
padding-bottom: 2.5rem; /* Footer height */
}
#footer {
position: absolute;
bottom: 0;
width: 100%;
height: 2.5rem; /* Footer height */
}
Example 2: how to keep footer bottom of the page css
.footerclass {
background-color: #eeeeee;
position: fixed;
top: auto;
bottom: 0;
width: 100%;
display: inline-block;
}
Example 3: how to fix the footer at the bottom of the page
#footer {
position:fixed;
left:0px;
bottom:0px;
z-index:1;
width:100%;
}
Example 4: keep footer at bottom of page
#footer {
position: relative;
margin-top: -180px;
/* negative value of footer height */
height: 180px;
clear: both;
/*Custom styling*/
}
/* Opera Fix thanks to Maleika (Kohoutec) */
body:before {
content: "";
height: 100%;
float: left;
width: 0;
margin-top: -32767px;
/* thank you Erik J - negate effect of float*/
}
Example 5: how to set the footer at the bottom using css
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="main.css" />
</head>
<body>
<div id="page-container">
<div id="content-wrap">
</div>
<footer id="footer"></footer>
</div>
</body>
</html>