Producing web pages
* HTML CSS DHTML XHTML A to Z of tags        Accessibility          Design

<body>

<body
alink=colour
background=url
bgcolor=colour
bgproperties=fixed
bottommargin=n
class=type
dir=ltr|rtr
id=value
lang=language
leftmargin=n
link=colour
rightmargin=n
scroll=string
style=style
text=colour
topmargin=n
title=text
vlink=colour
</body>

The <body> tag contains all the text, pictures and sounds that make up the page (as opposed to information about the page that goes in the <head> section). Put the <body> tag straight after the </head> tag and the </body> tag immediately before the </html> tag.

This tag also allows you to set a background picture, the background colour, the link colours, and the top and left margins of the page.

For example, the HTML used to insert the background picture is:

<body background="images/watermark.gif" 
bgproperties="fixed" bgcolor="#ffffff" text="#000000" 
link="#ff6600" vlink="#330099">

Attributes

alink=colour

Specifies the colour of the active link. A link is active when you click on it and it changes colour to confirm the click. This is the colour that the link text appears the first time you click on it. The default colour is red (#FF0000).

background=url

Specifies a background picture.

<body background="bkgimage.gif">

The browser tiles the picture behind the text and graphics on the page. It is a bit like wallpaper on your Windows desktop. You can use gif or jpeg files; Internet Explorer also accepts bmp files.

If you turn off the downloading of embedded pictures to speed things up, the background picture doesn't load. In this case, if you have not set the background colour for the page, the browser ignores the colours of the text and links. This stops the page being unreadable if the text and link colours clash with the default background colour for the browser.

bgcolor=colour

Sets the background colour of the page. Enter a hexadecimal, a red-green-blue colour value or a predefined colour name. See Using colour.

bgproperties=fixed

Specifies that the background picture is a watermark. It remains fixed and does not scroll with the page.

bottommargin=n

Specifies the bottom margin in pixels for the page; it overrides the default margin. If you set to zero, the bottom margin will be exactly on the bottom edge.

class=type

Indicates the class to which the tag belongs. You can use the class attribute in a style sheet to create different styles that you want apply to a single HTML tag. For example, you might create three different styles for a <body> tag. See Using the class attribute as a selector for more details.

dir=ltr|rtr

Specifies the direction of text. This can be left-to-right (ltr) or right-to-left (rtl). For example, English characters are presented left-to-right, Hebrew characters are presented right-to-left.

id=value

Specifies a unique name for the tag. No two tags can have the same id on a single page. The value must begin with a letter followed by any alphanumeric character, a hyphen, an underscore, a colon or a full stop. You use it to reference a unique style for a tag or to manipulate the tag with a script.

lang=language

Specifies which language the <body> tag uses. You can enter any valid ISO standard language abbreviation, for example, “en” for English, “de” for German and so on. For example, <span lang="es">hola! como esta?</span>.

This attribute helps search engines understand different languages as different languages rather than just misspelled English. It may also help spelling and grammar checkers and allow speech synthesizers to use language-dependent pronunciation rules.

leftmargin=n

Specifies the left margin in pixels for the page; it overrides the default margin. If you set to zero, the left margin will be exactly on the left edge.

link=colour

Sets the colour of links that have not yet been visited. The default colour is blue (#0000FF). Enter a hexadecimal, a red-green-blue colour value or a predefined colour name. See Using colour.

rightmargin=n

Specifies the right margin in pixels for the page; it overrides the default margin. If you set to zero, the right margin will be exactly on the right edge.

scroll=string

Set to either YES or NO. If you set to NO, this removes the page scroll bars.

style=style

Specifies style information. See Style sheets for more information.

text=colour

Sets the colour of text on the page. The colour can be a hexadecimal, a red-green-blue colour value or a predefined colour name. See Using colour.

title=text

For information only. Some browsers display the title when you move the mouse over the tag (like a tool tip).

topmargin=n

Specifies the margin for the top of the page in pixels; it overrides the default margin. If you set to zero, the top margin will be on the precise top edge.

vlink=colour

Sets the colour of links that have already been visited. The default colour is purple (#800080). Enter a hexadecimal, a red-green-blue colour value or a predefined colour name. See Using colour.