The main body of an HTML document where all of the content is placed. You must use this element and it should be used just once. It must start immediately after the closing >/head< tag and end directly before the closing >/html< tag.
The <body> element defines the document's body.
The <body> element contains all the contents of an HTML document, such as text, hyperlinks, images, tables, lists, etc.
The <body> element wraps around all of the content that will be displayed on screen (or in other media, such as print), such as headings, paragraphs, images, tables, and so on. It has some unique attributes, including >alink="", >link="", and >vlink="", all of which are now deprecated, as well as a number of other attributes that aren’t defined in any standard but are, regrettably, still in common use. These are:
marginheight=""
- sets the space between the top and bottom of the document content and the viewport (originally defined by Netscape 4).
marginwidth=""
- sets the space between the left and right of the document content and the viewport (originally defined by Netscape 4).
topmargin/bottommargin=""
- Internet Explorer’s equivalent of marginheight (allows us to set top and bottom margins separately).
leftmargin/rightmargin=""
- Internet Explorer’s equivalent of marginwidth (allows the setting of left and right margins separately).
Note that these attributes are no longer required to achieve the visual effects they were originally intended for—the equivalent CSS for these attributes is the margin property (or margin-top, margin-right, and so on), which is supported by all browsers.
All web pages require a <body> element, with the exception of frameset-based web pages, for which the appropriate frameset doctype must be declared.
Example
The body contains all the content that’s to be made visible to the user:
<body>
<h1>101 Ways to make a paper aeroplane</h1>
<p>Let's start with the basics …</p>
</body>
Use <body> to hold all the document content that you want to be visible to the reader.