Semantic HTML
Semantic HTML gives meaning to webpage structure. Instead of using only div tags, professional developers use meaningful tags like header, nav, main, section, article and footer.
header
Represents the top area of a page or section.
nav
Represents navigation links or menu area.
main / section
Represents the main content and content sections.
footer
Represents bottom information of a page or section.
After This Chapter, You Will Understand
This chapter helps you create meaningful, readable and professional webpage structures.
Meaningful Tags
Understand why semantic tags are better than random div tags.
Page Structure
Create header, nav, main, sections and footer properly.
Accessibility
Use structure that browsers and assistive tools can understand.
SEO Support
Help search engines better understand page content hierarchy.
What is Semantic HTML?
Semantic HTML means using HTML tags according to their meaning and purpose.
1 Simple Meaning
A semantic tag clearly tells the browser and developer what type of content it contains. For example, <header> means header area, <nav> means navigation, and <footer> means footer area.
2 Why It Matters
- Makes code easier to read
- Improves webpage structure
- Supports SEO-friendly content organization
- Improves accessibility for screen readers
- Makes future editing easier
Semantic Webpage Layout
A professional webpage should have clear and meaningful structure.
<section>
Main Content
Related Tips
3 Recommended Layout
A basic semantic webpage can be planned with header, nav, main, section, article, aside and footer. This gives a clean structure to both users and search engines.
<nav>Menu links</nav>
<main>
<section>About section</section>
<article>Course article</article>
</main>
<footer>Footer details</footer>
Div-Based Layout vs Semantic Layout
Both may look similar in browser, but semantic structure is easier to understand and maintain.
4 Less Meaningful
<div>Menu links</div>
<div>Main content</div>
<div>Footer details</div>
5 More Professional
<nav>Menu links</nav>
<main>Main content</main>
<footer>Footer details</footer>
Create a Semantic Institute Page
Edit the code and click Run Code to see the output.
Mistakes Students Should Avoid
Semantic HTML works best when tags are used according to their actual meaning.
Wrong Habits
- Using div for every part of the page
- Using nav for non-navigation content
- Putting multiple main tags unnecessarily
- Using section without heading
- Using semantic tags only for design purpose
Correct Habits
- Use header for top page area
- Use nav only for navigation links
- Use one main tag for main content
- Use section for grouped content
- Use footer for bottom information
Test Your Understanding
Select the correct answers and check your score.
1. Semantic HTML means:
2. Which tag is used for navigation links?
3. Which tag represents the main unique content of a page?
4. Which tag is suitable for bottom information of a page?
5. Which tag is used for side content related to main content?
Remember These Points
Revise these before moving to Chapter 10.
Semantic HTML
It uses meaningful tags to describe page structure and content purpose.
header
It is used for top or introductory page/section content.
nav
It is used for navigation links or menus.
main
It represents the main unique content of the page.
section
It groups related content into a meaningful block.
footer
It is used for bottom information such as copyright and links.