Layout Tags (header, footer, nav, aside)
Site: | Philippine Science High School - MC - Knowledge Hub |
Course: | SY25.CS3.Web Development |
Book: | Layout Tags (header, footer, nav, aside) |
Printed by: | , Guest user |
Date: | Thursday, 7 August 2025, 9:56 AM |
1. Introduction
After completing this module, you are expected to:
- Compare the differences of HTML and HTML5 Demonstrate the use of various HTML5 tags
- Demonstrate the use of various HTML5 tags
2. Semantic Markup
Semantic markup or semantic HTML brings meaning to a web page than just presentation.
Take for example the element. It is used to layout web pages and may wrap a navigational
menu or a list of blog posts but by itself it doesn't convey what it is representing in a page. CSS classes applied to elements displays information about their intended purpose.
HTML5 includes a set of markup elements to solve this matter. The new elements have names that gives a clear idea about their content. Listed below are the semantic elements of HTML5:
-
<header>
- <footer>
- <section>
- <aside>
- <nav>

2.1. The <header> tag
The <header> element represents the whole page's header or a section of it and usually contains a logo, search, navigational links, etc.
This tag doesn’t present a new section in the outline. A <header> element commonly contains the heading (an <h1>-<h6> element) of a surrounding section. However, this is not required.
The <header> tag is one of the HTML5 elements. In an HTML document, it is allowed to use several <header> tags, which can be placed in any part of it.
Note: It is not permitted to place the <header>
tag inside the <footer> and <address> elements, and in another <header> tag.
The following shows how a <header> element is used:
<header>
<h1> This is a page heading </h1>
</header>
2.2. The <nav> tag
<nav> element provides navigation links, either to other pages or within the current page and is defined this way:
“The <nav> element presents a section with navigation links.”
It is advised that <nav> is used only for the main navigational structures and not for a minor
set of hyperlinks (such as those found in the footer of a web page).
The following shows how a <nav> element is used:
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About Us</a></li>
<li><a href="#">Contact Us</a></li>
</ul>
</nav>
2.3. The <section> tag
The <section> element is used to group related elements and may be used to define navigation, in the header or footer, or within articles. Some examples where it can be used include the section of a web page for contact information, announcement section of a web page, and pages of a
tabbed user interface. A section usually has some heading.
The given markup below displays how the <section> element looks:
<section>
<h1>This is a section heading</h1>
<p>
Hello world! Hello world! Hello world!
Hello world! Hello world! Hello world!
Hello world! Hello world! Hello world!
</p>
</section>
A section may contain a <header> as well as a <footer> element. It is analogous to a printed
book section containing chapters or a section of a newspaper containing news items.
2.4. The <article> tag
An <article> element describes a self-contained composition in a page, application, document, or site intended to be independently reusable or distributable (e.g. a newspaper or magazine
article, a user- submitted comment, a blog entry, a forum post etc.).
The given markup below displays how the <article> element could be used:
<article>
<h1>This is article heading</h1>
<p>
Hello world! Hello world! Hello world!
Hello world! Hello world! Hello world!
Hello world! Hello world! Hello world!
</p>
</article>
Sometimes <section> and <article> are used together and sometimes, on nested <article> elements. There are no rules dictating their nesting.
2.5. The <aside> tag
<aside> element identifies content related to the main content of a page but does constitute
the main content of the webpage (e.g. related links, advertisements, author information, related content etc).
The given markup below displays how the <aside> element looks:
<aside>
<figure>
<img src="images/laptop.png" height="100px" width="100px" />
<figcaption>Figure caption goes here</figcaption>
</figure>
<p>
Hello world! Hello world! Hello world!
Hello world! Hello world! Hello world!
</p>
</aside>
The <aside> element contains a <figure> element and text in the form of a <p> element. The <figure> element is intended to represent a figure and in turn contains <img> and <figcaption> elements. The <img> tag points to the actual image to be displayed and the <figcaption> element holds
the figure caption.
2.6. The <footer > tag
The <footer> element represents the footer of the whole page or a <section> element. It is
intended to contain footer information such as copyright notice.
<footer>
<hr/>
<p>Copyright (C) 2020. All rights reserved.</p>
</footer>
2.7. Using all the semantic tags together
- <!DOCTYPE html>
- <html>
- <head>
- <title>Sample HTML5 Layout</title>
- <style>
- article {
- padding:5px;
- border: dotted 3px #ff006e;
- margin-top:5px;
- }
- header {
- padding:0px;
- text-align: center;
- }
- aside {
- margin-top:5px;
- background-color: #f0eaea;
- padding:5px;
- text-align : center;
- font-style: italic;
- border: double 3px #b200ff;
- }
- section {
- padding:5px;
- border: dashed 3px #0026ff;
- margin-top:5px;
- }
- footer {
- padding:5px;
- text-align: center;
- font-weight: bold;
- }
- nav {
- text-align: center;
- }
- ul li {
- display: inline;
- padding-left:5px;
- padding-right:5px;
- text-align: left;
- font-size:16px;
- font-weight: bold;
- }
- </style>
- </head>
- <body>
- <header>
- <h1>This is page heading</h1>
- </header>
- <nav>
- <ul>
- <li><a href="#">Home</a></li>
- <li><a href="#">About Us</a></li>
- <li><a href="#">Contact Us</a></li>
- </ul>
- </nav>
- <article>
- <h1>This is article heading</h1>
- <p>
- Hello world! Hello world! Hello world!
- Hello world! Hello world! Hello world!
- Hello world! Hello world! Hello world!
- </p>
- </article>
- <aside>
- <figure>
- <img src="image.jpg" height="100px" width="100px" />
- <figcaption>Figure caption goes here</figcaption>
- </figure>
- <p>
- Hello world! Hello world! Hello world!
- Hello world! Hello world! Hello world!
- </p>
- </aside>
- <section>
- <h1>This is a section heading</h1>
- <p>
- Hello world! Hello world! Hello world!
- Hello world! Hello world! Hello world!
- Hello world! Hello world! Hello world!
- </p>
- </section>
- <footer>
- <hr/>
- <p>Copyright (C) 2020. All rights reserved.</p>
- </footer>
- </body>
- </html>

3. Summary and References
Summary
-
Semantic markup conveys its meaning and purpose clearly to the developers and the browser.
Web developers frequently use the <div> element to layout web pages. A <div> element may
wrap a navigational menu or house a list of blog posts, but merely using <div> doesn't convey
much information to developers or browsers. CSS classes applied to <div> elements reveal
information about their intended purpose.
- Semantic elements of HTML5 are listed below:
- <header>
- <footer>
- <section>
- <article>
- <aside>
- <nav>
- The <header> tag defines the header of a page or a section
- The <nav> element houses navigation menus or any navigational structure such as hyperlinks.
- The <section> element represents a section of a document or application.
- The <article> element represents an independent item section of content such as a blog post, forum post, or a comment.
- The <aside> element houses content related to the surrounding content but, at the same time, is a standalone piece of content in itself.
- The <footer> element presents the footer of the whole page or a