What is HTML5?
HTML5 is the latest version of HyperText Markup Language, the foundation of every web page. It defines the structure and meaning of web content through elements and tags.
Basic Document Structure
<!-- Every HTML5 page starts with this boilerplate --> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>My First HTML5 Page</title> </head> <body> <h1>Hello, World!</h1> <p>This is my first web page.</p> </body> </html>
Key Concepts
<!DOCTYPE html>— tells the browser this is an HTML5 document<html lang="en">— root element;langimproves accessibility & SEO<head>— metadata: title, charset, viewport, styles<body>— everything visible on the page lives here<h1>to<h6>— headings in order of importance<p>— paragraph text
💡 Try this code in the Editor tab — paste it and click Run!
Semantic HTML5 Elements
HTML5 introduced semantic elements, tags that describe meaning, not just appearance. Search engines and screen readers rely on them.
Structural / Layout Elements
<header>— top of a page or section (logo, nav)<nav>— navigation links<main>— primary content; only one per page<section>— thematic grouping of content<article>— self-contained content (blog post, card)<aside>— sidebar or supplementary content<footer>— bottom of a page or section
Content Elements
<h1>–<h6>— headings (h1 = most important)<p>— paragraph<a href="">— hyperlink<img src="" alt="">— image (always includealt)<ul>/<ol>/<li>— lists<div>— generic container (no semantic meaning)<span>— inline container
Example: Semantic Page Skeleton
<body> <header> <nav><a href="/">Home</a></nav> </header> <main> <section> <h1>Welcome</h1> <p>This is the main content.</p> </section> </main> <footer><p>© 2025</p></footer> </body>
HTML5 Knowledge Check
Test your understanding of the lessons. Select your answers and click Submit Quiz.
<img> tag for accessibility?W3Schools
Interactive tutorials with live examples and exercises. The go-to reference for quick lookups and beginners learning syntax.
Open W3SchoolsMDN Web Docs
Mozilla's authoritative reference for web standards. Deep technical documentation for understanding how and why things work.
Open MDN DocsFreeCodeCamp
Structured bootcamp with real projects and certifications. Build portfolio-worthy projects while earning proof of your skills.
Open FreeCodeCamp