Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Basic HTML Document Structure | Section
HTML Essentials

bookBasic HTML Document Structure

Swipe to show menu

Every HTML page follows the same basic structure. It defines how the browser should understand and display the content.

Here is a simple example of an HTML document:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>My First Page</title>
  </head>
  <body>
    <h1>Hello, World!</h1>
    <p>This is my first web page.</p>
  </body>
</html>

Main Parts of the Document

  1. <!DOCTYPE html>: tells the browser to use the modern HTML5 standard;
  2. <html>: the root element. Everything on the page is placed inside this tag;
  3. <head>: contains information about the page that is not visible to users. Common elements:
    • <title>: sets the name of the browser tab;
    • <meta charset="UTF-8">: ensures text displays correctly.
  4. <body>: contains everything users see on the page:
    • text;
    • images;
    • links;
    • buttons.

How to Think About It

<head> → page settings. <body> → page content.

Note
Note

You don't need to memorize everything yet. Focus on recognizing the structure. You'll use it in every HTML file.

Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 1. Chapter 3

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

Section 1. Chapter 3
some-alt