HTML5 Document Skeleton: DOCTYPE, html, head, and body
Every compliant HTML page starts with a standardized boilerplate. Understanding each structural element ensures your site renders properly across all devices and browsers.
1. The Universal HTML5 Boilerplate
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mastering Modern HTML5 - Devify</title>
</head>
<body>
<header>
<h1>Welcome to Modern Web Engineering</h1>
</header>
<main>
<p>Your main article or application interface begins here.</p>
</main>
<footer>
<p>© 2026 Devify Platform. All rights reserved.</p>
</footer>
</body>
</html>
2. Breakdown of the Root Elements
<!DOCTYPE html>: Informs modern web browsers to render the document in standard mode rather than legacy quirks mode.<html lang="en">: The root element enclosing all content. Thelangattribute is essential for screen readers and search engines to detect the primary language.<head>: Houses non-visual metadata, title tags, stylesheet links, and preconnect hints.<body>: Contains all visual content rendered in the browser viewport.
3. Best Practices
- Always declare the
langattribute on<html>for accessibility compliance (WCAG 2.1). - Avoid placing visual tags (like
<h1>or<div>) inside the<head>tag. - Keep the
DOCTYPEat line 1 with zero preceding whitespace.

