Skip to content
\n","url":"https://ez4code.com/snippets/html-semantic","keywords":"html, semantic","author":{"@type":"Person","name":"EZ4Code Team"},"publisher":{"@type":"Organization","name":"EZ4Code","logo":{"@type":"ImageObject","url":"https://ez4code.com/logo.png"}},"datePublished":"2024-01-01","dateModified":"2026-08-01","image":"https://ez4code.com/og-image.png"}
HTML

Semantic Tags

HTML5 semantic structure.

By EZ4Code Team
htmlsemantic

Code

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Semantic Page</title>
</head>
<body>
    <header>
        <nav>
            <ul>
                <li><a href="/">Home</a></li>
                <li><a href="/about">About</a></li>
            </ul>
        </nav>
    </header>

    <main>
        <article>
            <header>
                <h1>Article Title</h1>
                <time datetime="2024-01-15">January 15, 2024</time>
            </header>
            <section>
                <h2>Section 1</h2>
                <p>Content paragraph...</p>
            </section>
            <section>
                <h2>Section 2</h2>
                <p>More content...</p>
            </section>
            <footer>
                <p>Author: John</p>
            </footer>
        </article>

        <aside>
            <h3>Sidebar</h3>
            <p>Related links...</p>
        </aside>
    </main>

    <footer>
        <p>&copy; 2024 Demo Site</p>
    </footer>
</body>
</html>

Explanation

Semantic tags improve accessibility and SEO; header/nav/main/article/section/aside/footer each have semantics.

More HTML Snippets