Reputation: 915
Here is my code, at the moment:
<section id="one">
<h2>Section Title</h2>
<p>Lorem ipsum...</p>
<p>Lorem ipsum...</p>
<p>Lorem ipsum...</p>
</section>
<section id="two">
<h2>Section Title</h2>
<p>Lorem ipsum...</p>
<p>Lorem ipsum...</p>
<p>Lorem ipsum...</p>
</section>
<section id="three">
<h2>Section Title</h2>
<p>Lorem ipsum...</p>
<p>Lorem ipsum...</p>
<p>Lorem ipsum...</p>
</section>
I was contemplating using the <header>
element to surround each section's <h2>
, but would I then also have to use a <footer>
element at the bottom of each section, as well? I have a feeling that the <footer>
element of each section would more often than not be empty, unless footnotes were necessary, such as a source of information, or notes about the information provided in a paragraph, etc.
Is this part of the specification's rules, or am I purely basing this on the assumption that "if you have one, you should have the other"?
Upvotes: 1
Views: 257
Reputation: 56626
No, you don't have to use both of them.
It's ok to use:
It's similar to Microsoft Word. You can create a document that has only the title as header, only the page number as footer, both of them or none of them.
Upvotes: 2
Reputation: 57600
No, you do not have to use both a header
and a footer
if you use one. They are similar, but completely independent. The HTML5 specification adds no such restrictions.
Content model: Flow content, but with no header, footer, or main element descendants.
The header element represents introductory content for its nearest ancestor sectioning content or sectioning root element. A header typically contains a group of introductory or navigational aids.
Content model: Flow content, but with no header, footer, or main element descendants.
The footer element represents a footer for its nearest ancestor sectioning content or sectioning root element. A footer typically contains information about its section such as who wrote it, links to related documents, copyright data, and the like.
When the footer element contains entire sections, they represent appendices, indexes, long colophons, verbose license agreements, and other such content.
Upvotes: 4
Reputation: 7769
HTML tags are only used to describe your content, you don't have to use any of header/footer
tags or you can use one of them, or both together, it's really up to you.
Edit: Also you can use them multiple times in a single html file
Upvotes: 0