liveBook · Manning

Body element

As explained in Web Design Playground, Second Edition

A body element is the HTML document component that contains the page content rendered in the web browser.

The body element is the part of an HTML page that holds the content users see in the browser. It is marked by an opening <body> tag and a closing </body> tag; the head carries behind-the-scenes information, while the body carries the visible page. section 2.5 section 2.16

Place the page’s visible building blocks inside the body:

  • Add text and HTML tags such as headings, paragraphs, emphasis, strong text, and links. section 2.16
  • Keep styling definitions in the head’s style element, while applying broader CSS properties to the body when needed. section 2.5 section 5.7
  • Do not rely on repeated spaces, tabs, or line breaks to structure content; browsers generally ignore them. section 2.7

A body with visible content

In a complete page, place the content between the body tags: <body> Hello HTML World! </body> The words inside the body appear in the browser’s content area. A page containing only the surrounding structure displays no body content—an elegant frame with nothing inside it. section 2.7

<!DOCTYPE html>                   #1
<html lang="en">                  #2
    <head>                        #3
        <meta charset="utf-8">    #4
        <title></title>           #5
        <style></style>           #6
    </head>                       #3
    <body>                        #7
    </body>                       #7
</html>                           #2

Use the minimal page structure to see how the body sits alongside the head and contains the page content. section 2.5

How Web Design Playground, Second Edition covers it

How deep it goes
Defines opening and closing tags, distinguishes body from head, and demonstrates visible text while deferring whitespace and paragraph behavior.
Examples
Uses a minimal HTML page containing “Hello HTML World!” to connect body content with its visible browser result.
What you can do after
Build it from scratch by placing visible text and HTML elements inside the body element.
How it connects
Connects the body element to the head section, HTML tags, CSS, headings, links, and browser rendering.

Also explained in

Compare how 2 books explain body element →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Web Design Playground, Second Edition. The section links point to the parts of the book it draws on.