Skip to content

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy
HTML

HTML: Use Semantic Elements for Meaningful Structure

- 05.07.26 - ErcanOPAK

📐 Semantic HTML = Meaningful Structure

<div> everywhere is messy. Semantic elements give meaning. Accessibility, SEO, readability — all benefit.

❌ Non-Semantic

<div class="header">
    <div class="nav"></div>
</div>
<div class="main">
    <div class="article"></div>
    <div class="aside"></div>
</div>
<div class="footer"></div>

✅ Semantic

<header>
    <nav></nav>
</header>
<main>
    <article></article>
    <aside></aside>
</main>
<footer></footer>

📝 Semantic Elements

<header> - Page header (logo, navigation)
<nav> - Navigation links
<main> - Main content (only one per page)
<article> - Self-contained content (blog post)
<section> - Thematic grouping of content
<aside> - Sidebar, related content
<footer> - Page footer (copyright, links)
<figure> - Self-contained media (image with caption)
<figcaption> - Caption for figure
<time> - Date and time
<mark> - Highlighted text
<details> - Collapsible content
<summary> - Summary for details
<address> - Contact information
<blockquote> - Quoted content
<cite> - Citation

🎯 Complete Page Example

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>My Website</title>
</head>
<body>
    <header>
        <h1>My Website</h1>
        <nav>
            <ul>
                <li><a href="#">Home</a></li>
                <li><a href="#">About</a></li>
                <li><a href="#">Contact</a></li>
            </ul>
        </nav>
    </header>

    <main>
        <article>
            <h2>Blog Post Title</h2>
            <time datetime="2024-01-15">January 15, 2024</time>
            <p>This is the content of the blog post.</p>
            <figure>
                <img src="image.jpg" alt="Description">
                <figcaption>Image caption</figcaption>
            </figure>
            <section>
                <h3>Section Heading</h3>
                <p>Section content...</p>
            </section>
        </article>

        <aside>
            <h3>Related Content</h3>
            <ul>
                <li><a href="#">Related post 1</a></li>
                <li><a href="#">Related post 2</a></li>
            </ul>
        </aside>
    </main>

    <footer>
        <p>&copy; 2024 My Website. All rights reserved.</p>
        <address>
            Contact: <a href="mailto:info@example.com">info@example.com</a>
        </address>
    </footer>
</body>
</html>

💡 Benefits

  • Accessibility (screen readers understand)
  • SEO (search engines understand)
  • Readability (code is self-documenting)
  • Maintainability (easier to update)
  • Future-proof (standardized)

“Semantic HTML gives meaning. Accessibility, SEO, clarity — all improved. Essential for web development.”

— Web Developer

Related posts:

HTML5 — autocomplete Can Leak Sensitive Data

HTML5: Professional Image Optimization with and WebP

HTML: Use Correct Input Types for Better Mobile Keyboards

Post Views: 0

Post navigation

CSS: Use Box Shadow for Depth and Dimension
JavaScript: Use Local Storage for Client-Side Data

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

July 2026
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  
« Jun    

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (960)
  • How to add default value for Entity Framework migrations for DateTime and Bool (898)
  • How to make theater mode the default for Youtube (857)
  • Get the First and Last Word from a String or Sentence in SQL (840)
  • How to select distinct rows in a datatable in C# (814)
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server (597)
  • Add Constraint to SQL Table to ensure email contains @ (582)
  • Average of all values in a column that are not zero in SQL (545)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (512)
  • Find numbers with more than two decimal places in SQL (460)

Recent Posts

  • C#: Use Using Statements for Resource Management
  • C#: Use Lambda Expressions for Concise Code
  • SQL: Use GROUP BY for Data Aggregation
  • .NET Core: Master Routing for Clean URLs
  • Git: Use Reset to Undo Local Changes
  • Ajax: Use Axios for HTTP Requests
  • JavaScript: Understand Hoisting
  • HTML: Use Web Storage for Client-Side Data
  • CSS: Use Filter Effects for Visual Magic
  • Windows 11: Unlock God Mode for All Settings

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (960)
  • How to add default value for Entity Framework migrations for DateTime and Bool (898)
  • How to make theater mode the default for Youtube (857)
  • Get the First and Last Word from a String or Sentence in SQL (840)
  • How to select distinct rows in a datatable in C# (814)

Recent Posts

  • C#: Use Using Statements for Resource Management
  • C#: Use Lambda Expressions for Concise Code
  • SQL: Use GROUP BY for Data Aggregation
  • .NET Core: Master Routing for Clean URLs
  • Git: Use Reset to Undo Local Changes

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
© 2026 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com