<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Web Page</title>
</head>
<body>
<header>
<h1>Welcome to 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>Article Title</h2>
<p>This is a paragraph within an article.</p>
</article>
<aside>
<h3>Related Links</h3>
<ul>
<li><a href="#">Link 1</a></li>
<li><a href="#">Link 2</a></li>
</ul>
</aside>
</main>
<footer>
<p>© 2023 My Website. All rights reserved.</p>
</footer>
</body>
</html>
HTML documents have a hierarchical structure. The root element is <html>, which contains <head> and <body> sections. The <head> contains metadata about the document, while the <body> contains the main content of the page.
HTML5 introduced elements with semantic meaning (like those listed above). These provide more context about the structure and purpose of content, improving accessibility and SEO.
Elements can be nested inside each other. Proper nesting is important for valid HTML.
Elements can have attributes that provide additional information. Common attributes include id, class, and style.
Some elements like <br>, <img> don't have closing tags.
<!-- Comment text --> can be used to add comments to your HTML code.