The HTML Body Section
When you create a blank HTML document, if the body section is left blank you will see nothing on the screen. The <body> tag is the central and most important part in an HTML document. In fact, it is needed to be able to see anything on the screen. While the header tag is important also, mostly every standard tag in HTML goes into the body. It is the core of the page.
| List of <body> tag's attributes | |
| alink | Determines a color of active link (when mouse button pressed). |
| background | Determines a background image. |
| bgcolor | Determines a background color |
| bgproperties | Determines either background will be scrolled with content of page or not. Have one value "fixed" only. |
| link | Determines color of hyperlinks. |
| vlink | Determines color of visited hyperlinks. |
| text | Determines color of text on page. |
| scroll | Determines either show scroll bars or no. |
| bottommargin, leftmargin, topmargin | Margins from bottom, left or top edge of browser window. |
The body tag can be used to control the background color of the document by setting the attribute "bgcolor" using a hex value (see the tutorial on Colors for details).
You can add other attributes to control the link and text colors and they will be the defaults for the web page you are attempting to build. Additionally, you can set an image to become the background through the background attribute. For the image to load in all popular browsers, it is recommended to be in the jpeg format as it generally loads faster than gif or png images.
If image is not found or browser don't show pictures, image will not appeared. Background will have color which determines by "bgcolor" tag.
Here is an example of how you would set the background to be an image called “img01.jpg”, the black background color, white color of text and visited links, blue color for active links and disable scroll bars.
Examples
Content of the page
<body>
This examle shows basic use of <body> tag.
Content of the page
</body>
As always, remember your basic tags and that should be the key to formatting. If you have it down, you should have no trouble building your web pages.
<head>
<title>
</title>
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
</body>
</html>
Remember with your body tag that you can customize it with the examples as seen above.
Congratulations, you now have the basic understanding on how an HTML page operates. If you are looking for tag references go to The HTML Tag List or if you are confident enough in your own abilities, go to tables, frames or forms. These items will come in great handy and will expand beyond the basics of HTML.