04 / 06

Explain the structure of a basic HTML document.

Structure of a Basic HTML Document

A basic HTML document follows a standard structure that tells the browser how to interpret the content. It starts with a document type declaration, followed by the <html> root element, which contains two main sections: the <head> and the <body>.

Basic HTML Document Example
Main Parts of an HTML Document
  1. 1<!DOCTYPE html> – Declares the document type and version of HTML.
  2. 2<html> – The root element that wraps all content on the page.
  3. 3<head> – Contains metadata such as the page title, character encoding, and linked stylesheets or scripts.
  4. 4<title> – Sets the title of the web page shown in the browser tab.
  5. 5<body> – Contains all the visible content like text, images, links, and other elements.