Basic 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
<!DOCTYPE html>: tells the browser to use the modernHTML5standard;<html>: the root element. Everything on the page is placed inside this tag;<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.
<body>: contains everything users see on the page:- text;
- images;
- links;
- buttons.
How to Think About It
<head> → page settings. <body> → page content.
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?
Thanks for your feedback!
Section 1. Chapter 3
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Section 1. Chapter 3