Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Basic Structure of an HTML Document | Understanding the Web and HTML
HTML Essentials

bookBasic Structure of an HTML Document

A typical HTML document looks like this:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Title of the Document</title>
  </head>
  <body>
    <!-- Content goes here -->
  </body>
</html>
Note
Note

No worries, you will explore each aspect in depth in the upcoming chapters. For now, look and get familiar with the visual appearance of HTML.

Structure brief summary

  • <!DOCTYPE html>: tells the browser which version of HTML the document is using. In this case, it's HTML5, the latest version of HTML;
  • <html>: is the root element of the HTML document. All other elements are contained within this element;
  • <head>: contains meta-information about the document, such as the character encoding (<meta charset="UTF-8">) which ensures that special characters are displayed correctly, and the document title (<title>) which appears in the browser's title bar or tab;
  • <title>: sets the title of the document, which is displayed in the browser's title bar or tab;
  • <body>: is where the web page's main content goes. You'll place text, images, links, forms, and other elements inside the <body> element. This is what users will see and interact with when they visit your web page.

Code editor link - Visual Studio Code

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 5

Ask AI

expand

Ask AI

ChatGPT

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

Suggested prompts:

Can you explain what each part of the HTML structure does?

What are the benefits of using Visual Studio Code for web development?

How do I use the Live Server extension to preview my website?

Awesome!

Completion rate improved to 2.86

bookBasic Structure of an HTML Document

Swipe to show menu

A typical HTML document looks like this:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Title of the Document</title>
  </head>
  <body>
    <!-- Content goes here -->
  </body>
</html>
Note
Note

No worries, you will explore each aspect in depth in the upcoming chapters. For now, look and get familiar with the visual appearance of HTML.

Structure brief summary

  • <!DOCTYPE html>: tells the browser which version of HTML the document is using. In this case, it's HTML5, the latest version of HTML;
  • <html>: is the root element of the HTML document. All other elements are contained within this element;
  • <head>: contains meta-information about the document, such as the character encoding (<meta charset="UTF-8">) which ensures that special characters are displayed correctly, and the document title (<title>) which appears in the browser's title bar or tab;
  • <title>: sets the title of the document, which is displayed in the browser's title bar or tab;
  • <body>: is where the web page's main content goes. You'll place text, images, links, forms, and other elements inside the <body> element. This is what users will see and interact with when they visit your web page.

Code editor link - Visual Studio Code

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 5
some-alt