Courses / HTML
Free Beginner Web Development

HTML & Web Foundations

Learn how websites are structured from the ground up using HTML. Build real pages while learning elements, attributes, links, images, forms, tables, semantic HTML and more.

24
Lessons
4 Weeks
Duration
4%
Progress

Lesson 2 of 24

12 min learning time

HTML Document Structure

The basic structure

Every normal HTML page follows a basic document structure. Understanding this structure makes it easier to organize larger websites.

DOCTYPE

The DOCTYPE declaration tells the browser that the document uses modern HTML.

Head and Body

The head contains information about the document, while the body contains the content displayed on the page.

Example HTML
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>My Page</title>
</head>
<body>

    <h1>Welcome</h1>

</body>
</html>

Practical Exercise

Build it yourself

Create a complete HTML document with a title, viewport meta tag, heading and paragraph.

Quick Check

Test your understanding

Which section contains content normally displayed to the user?