05 / 06

What is the difference between <head> and <body>?

Difference Between <head> and <body>

In an HTML document, the <head> and <body> serve different purposes. The <head> contains metadata and resources for the browser, while the <body> contains the actual content displayed to users.

Basic Structure Example
Key Differences
  1. 1<head>: Contains metadata such as title, character encoding, and links to CSS/JS files.
  2. 2<body>: Contains visible content like text, images, and videos.
  3. 3

    Content in <head> is not shown directly to users but affects how the page works.

  4. 4

    Content in <body> is shown directly in the browser window.