Understanding HTML Document Structure
Every HTML document follows a basic structure. The DOCTYPE declaration tells the browser which version of HTML the page is using.
The element is the root element that contains all other elements. The
section contains metadata, while the section contains the visible content.<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Page Title</title>
</head>
<body>
<!-- Your content goes here -->
</body>
</html>
- - Declares HTML5 document type
- <html> - Root element of the page
- <head> - Contains metadata and links to resources
- <title> - Sets the page title shown in browser tab
- <body> - Contains all visible content
Try Basic Structure
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My Website</title>
</head>
<body>
<h1>Welcome to My Website</h1>
<p>This is the content area.</p>
</body>
</html>
Note: Always include the DOCTYPE declaration and proper document structure for valid HTML.