I was trying to make sticky footer for my website, i have used javascript to create element in this case for specific reason, i created <footer>
element and tried to get it fully at bottom at every resolution of width.
I want to append footer at body only, so this is my javascript:
$(function () {
$('.products').each(function(i, obj) {
if (i > 0) {
obj.id = "p" + i
var pl = document.createElement("footer");
var t = document.createTextNode(i);
pl.className = "pageblock"
pl.appendChild(t);
document.body.appendChild(pl);
}
});
});
This creates footer, in this case single footer only, and editing style of .pageblock
class works.
To bring footer fully down, i have tried this:
.pageblock {
clear: both;
position: relative;
text-align: center;
bottom: 0;
z-index: 10;
font-family: 'Lato';
font-size: 3em;
color: white;
font-weight: bold;
}
but for some reason, it still wouldn't work, it would be stuck in somewhere nearby vertical center. Check for "1" here.
I have flex layout on website, so elements horizontally scale with browsers with and increase vertical size.
Is there any way i can fully move element to the bottom so it's always there, even when vertical size get's bigger or smaller? Is there any way i can do this without wrapping everything up in single div which may damage the code itself?
Thanks!