I was trying to position a footer at bottom of page or bottom of screen, whichever is lower. I thought the following would work:
body { margin-bottom: 4em; }
.footer { position:absolute; bottom: 0 }
But the above always put .footer at bottom of screen, even if the page was longer than the screen. I struggled for hours until I found that the following was needed:
html { position: relative }
I can't find documentation for the position
style when applied to the html
element. What does this style do the html
element? Html
is the father of all elements, so what does position
mean? What is the default value for position
for element html
?