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

bookBasic Structure of an HTML Document

An HTML document follows a basic structure consisting of several elements. Here's a typical structure of an HTML document:

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

Structure brief summary

  • <!DOCTYPE html>: This line tells the browser which version of HTML the document is using. In this case, it's HTML5, the latest version of HTML;
  • <html>: This is the root element of the HTML document. All other elements are contained within this element;
  • <head>: This section 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>: This element sets the title of the document, which is displayed in the browser's title bar or tab;
  • <body>: This 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.

Video Tutorial

Code editor link - Visual Studio Code

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 1. Kapittel 5

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

Awesome!

Completion rate improved to 3.13

bookBasic Structure of an HTML Document

Sveip for å vise menyen

An HTML document follows a basic structure consisting of several elements. Here's a typical structure of an HTML document:

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

Structure brief summary

  • <!DOCTYPE html>: This line tells the browser which version of HTML the document is using. In this case, it's HTML5, the latest version of HTML;
  • <html>: This is the root element of the HTML document. All other elements are contained within this element;
  • <head>: This section 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>: This element sets the title of the document, which is displayed in the browser's title bar or tab;
  • <body>: This 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.

Video Tutorial

Code editor link - Visual Studio Code

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 1. Kapittel 5
some-alt