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

The HTML body

You use the <body> tag to identify the main part of your page. You put the content of your page within this tag. You can include all the usual suspects: your headings, paragraphs, lists, tables, pictures and sounds, links to other pages and forms to fill in. You can format your text in a variety of ways, including changing the font, making text bold and so on.

The <body> tag itself has a number attributes that let you control the look of your page. If you don't add any attributes, the browser usually displays black text on a white background.

You can use the <body> tag to:

  • Set the colour of text. For example, set the text colour to blue
  • Set the colour of links. For example, you can set the colour of new links to blue, visited links to purple, and active links to red
  • Change the background of your page. You can change the background colour or add a background picture to the page. If you don't set a colour, the page will probably have a white background. You could, for example, change it to black

Note: In some HTML documents, the <body> tag doesn't appear. You see a <frameset> tag that defines the frames that provide the content of the document instead. For more information, see Using frames.

You can now start to add some basic headings and paragraphs to your page.