HTML <footer> Tag โ Page Footer
๐ Introduction
The <footer> tag is used to define the bottom section of a webpage or a section.
It usually contains:
- Copyright information
- Contact details
- Social media links
- Additional navigation
It is a semantic HTML5 element, meaning it clearly describes its purpose.
๐งฑ Syntax
<footer>Content here</footer>
๐ก Example
<!DOCTYPE html>
<html>
<head>
<title>Footer Example</title>
</head>
<body>
<h1>Main Content</h1>
<p>This is the body of the page.</p>
<footer>
<p>ยฉ 2026 My Website. All rights reserved.</p>
</footer>
</body>
</html>
๐ฅ๏ธ Output Explanation
- The
<footer>appears at the bottom of the page - It contains secondary or closing information
- It separates main content from extra details
๐ฏ What Goes Inside <footer>?
Common elements:
- Copyright text
- Author information
- Links (privacy policy, terms)
- Contact info
- Social media icons
Example:
<footer>
<p>ยฉ 2026 Ahmed Codes</p>
<a href="#">Privacy Policy</a>
<a href="#">Contact</a>
</footer>
๐ง Important Concept
๐ Like <header>, <footer> can be used:
- For the entire page
- Or inside sections/articles
Example:
<article>
<h2>Blog Post</h2>
<p>Content here...</p>
<footer>
<p>Written by Ahmed</p>
</footer>
</article>
โ๏ธ <footer> vs <div>
| Tag | Type | Purpose |
|---|---|---|
<footer> |
Semantic | Defines footer area |
<div> |
Generic | No meaning |
โ Use <footer> for real footer content
๐ฏ Why <footer> is Important
- Improves website structure
- Helps SEO
- Makes layout professional
- Improves accessibility
๐ซ Common Mistakes
- Using
<footer>for main content โ - Putting everything in footer โ
- Not separating page structure โ
๐จ Styling Example
<footer style="background:#222; color:white; text-align:center; padding:10px;">
ยฉ 2026 My Website
</footer>
๐งช Mini Exercise
Create a page with:
A header
A main paragraph
A footer with:
- Copyright text
- A link
Style the footer with dark background