Search code examples
htmlcssfooter

HTML footer position - must body be parent element?


Is it OK to put the footer element inside a div or must the body element be it's parent? I suspect the answer here is no but I just want to clarify


Solution

  • The only restriction is an html-document having one root-node html and htmlcontaining headand body. For the position of the footer, you are free to use it nearly anywhere you like.

    If you are unsure use the spec, it tells you, where a specific element may be positioned.