Home Tutorials HTML Tutorial Basic HTML Document Structure
Basic HTML Document Structure

Basic HTML Document Structure


2. Basic HTML Document Structure

Every HTML page typically includes <!DOCTYPE html>, the root <html> element, a <head> section for metadata, and a <body> section for visible content. This structure helps browsers interpret the document correctly.

Syntax

<!DOCTYPE html>
<html>
<head>
    <title>Page Title</title>
</head>
<body>
    Content goes here
</body>
</html>

Example

<!DOCTYPE html>
<html>
<head>
    <title>My First Page</title>
</head>
<body>
    <h1>Welcome</h1>
    <p>This is my first HTML page.</p>
</body>
</html>

Output

A web page showing a large heading "Welcome" and a paragraph "This is my first HTML page."
Example

🏋️ Test Yourself With Exercises

Take our quiz on Basic HTML Document Structure to test your knowledge.

Browse Quizzes »