I've encountered numerous solutions for creating a sticky footer on Stack Overflow, and they have all been effective for me. However, I am facing an issue where I need to maintain a 60px space between my "content div" and my "footer div." Unfortunately, in the solutions I have tried so far, setting margin-top: 60px
for the "footer div" has not produced the desired result.
One solution that I came across:
<div id="container">
<div id="body">
<div id="teste">
</div>
</div>
<div id="footer">
</div>
</div>
html,
body {
margin:0;
padding:0;
height:100%;
}
#container {
min-height:100%;
position:relative;
}
#teste {
background: red;
height: 500px;
}
#body {
padding:10px;
padding-bottom:60px; /* Height of the footer */
}
#footer {
position:absolute;
bottom:0;
width:100%;
height:60px; /* Height of the footer */
background:#6cf;
margin-top: 60px; <---- this didn't work
}