How HTML Works

HTML is the foundation of any web page. When you visit a site, your browser requests an HTML file from a server, reads the tags inside, and renders the content visually for you to see.

How HTML Works: The Journey of a Web Page

Ever wondered what happens when you visit a website? It's like ordering a pizza! Your browser asks a server for a page, and the server sends back an HTML file. Let's break down this journey together.


Core Syntax

  • The basic structure includes the tags <!DOCTYPE html>, <html>, <head>, and <body>.
  • Most HTML tags require an opening and closing tag, like <p> and </p>.
  • Note: These tags will be explained in detail in future lessons.

Main Purpose

  • Define the structure and meaning of web content.
  • Provide a universal format for text and visual elements.
  • Enable browsers to correctly interpret and display content.

Practice Exercise

Let's practice creating a basic HTML document. In the editor below, create a structure with the following parts: <!DOCTYPE html>, <html>, <head>, a <title>, and a <body>.

* Write the code below. Correct characters will be shown in green and incorrect ones in red.

<!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> ... </body> </html>

Knowledge Check

What does the <head> tag represent in an HTML file?