codegurukool.com · Free coding tutorials & online compiler

Home › HTML Tutorial › Semantic layout

Semantic layout

Use elements that describe what content is.

Tags like header, nav, main, article, section and footer help screen readers and search engines understand your page.

Example code

<style>header,footer{background:#14213d;color:#fff;padding:8px}nav a{margin-right:10px}</style>
<header><h2>My Site</h2></header>
<nav><a href="#">Home</a><a href="#">About</a></nav>
<main><article><h3>Post title</h3><p>Post text.</p></article></main>
<footer>2026</footer>

Run this code in the online editor

← FormsClasses, ids and attributes →