Log in

View Full Version : In HTML5 <footer> tag of the whole page, have to be direct child of <body>



lse123
12-04-2012, 08:04 AM
In HTML5 <footer> tag of the whole page, have to be direct child of <body>,... of can reside in a big div include all body contents?

bernie1227
12-04-2012, 08:17 AM
As far as I can tell, the footer element does not have to be a direct child element of the head, after validating an example such as this:


<!DOCTYPE html>
<html>
<head>
<title>test</title>
</head>
<body>
<header>
<h1>test</h1>
<p>test</p>
</header>
<article>
<p>lorum</p>
<p>ipsum</p>
</article>
<div>
<footer>
© 2012 me
</footer>
</div>
</body>
</html>

it's prefectly valid. Also, after consulting numerous pieces of documentation, it appears to be perfectly fine to have it within a div.

traq
12-04-2012, 08:48 PM
Correct.

Also, you are not limited to one <footer>.
Individual sections, articles, etc. may have their own footer (and header as well).