On this page
HTML Semantic Elements (article, section, aside, nav)
HTML Semantic Elements: article, section, aside, nav
Focus Keyword: html semantic elements | Trending Keyword: semantic html5 tags
Semantic HTML elements are tags that clearly describe their meaning to both the browser and the developer. Instead of wrapping everything in generic <div> tags, HTML5 gives us purpose-built elements like <article>, <section>, <aside>, and <nav> that describe the role of the content they contain. Using semantic html elements improves accessibility, SEO, and code readability — which is exactly why "semantic html5 tags" remains a trending topic among modern front-end developers.
Why Semantic Elements Matter
- Accessibility: Screen readers use semantic tags to help visually impaired users navigate a page.
- SEO: Search engines like Google use semantic structure to better understand and rank page content.
- Maintainability: Developers can read the markup and immediately understand the page structure.
- Consistency: Semantic elements create a predictable document outline across projects and teams.
<article> Element
The <article> element represents a self-contained piece of content that could be independently distributed or reused — such as a blog post, news story, or forum post.
<section> Element
The <section> element groups related content together, typically with its own heading. Use it to break a page into thematic chunks such as "Features", "Pricing", or "Testimonials".
<aside> Element
The <aside> element holds content that is tangentially related to the main content — sidebars, pull quotes, advertisement blocks, or related-links widgets.
<nav> Element
The <nav> element wraps major navigation blocks, such as a primary menu, breadcrumb trail, or table of contents. Not every group of links needs a <nav> — reserve it for major navigation blocks only.
Putting It All Together
Below is a complete semantic page skeleton combining all four elements with <header>, <main>, and <footer> for full document structure.
article vs section: Key Differences
| Feature | <article> | <section> |
|---|---|---|
| Independence | Fully self-contained | Part of a larger whole |
| Reusable elsewhere | Yes (e.g. RSS feed) | No |
| Example | Blog post, product card | "About Us" section on a homepage |
Best Practices for Semantic Markup
- Always give a <section> a heading (h1–h6).
- Don't use <section> purely for styling — use <div> if there's no thematic grouping.
- Nest <article> inside <article> for comments on a blog post.
- Use ARIA landmarks only when semantic HTML can't cover the case.
- Validate your document outline with the W3C Nu HTML Checker.
Common Mistakes
- Using <section> as a generic styling wrapper (should be <div>).
- Wrapping the entire page's navigation links individually in separate <nav> tags.
- Forgetting that <aside> inside an <article> refers to content related to that article specifically.
Press Run to execute.
Press Run to execute.
Press Run to execute.
Rewrite the following div-based layout using proper semantic elements: header, nav, main, article, aside, and footer.
Press Run to execute.
This is a self-check — compare your result with the expected output above.
Was this page helpful?