Webpage Workshop: Home » HTML » The body section

The body section

The body section is where all the information that you want to appear on the page belongs. It is also the traditional place for setting the colors of the links and text, but now these are more often set using Cascading Stylesheets.

<body link="#??????" alink="#??????" vlink="#??????"
  text="#??????" background="URI" bgcolor="#??????">
  Text goes here
</body>

In the example above, the link attribute is used to set the color of the links on a page. The alink attribute sets the color of active links; that is a link that you are clicking on. The vlink attribute also changes the link color, but this changes the color of the links that you have already visited.

The background attribute is used to set an image as a background. This image will be tiled in the background if it is not big enough to fill the browser window. The bgcolor attribute also sets the background of a page, but sets a color rather than an image.

The attributes previously described can only be used when you are utilizing the transitional document type, so when you use the strict document type, your code would look more like this with CSS to set the colors etc:

<body>
  Text goes here
</body>

Any text that you type into this section will be displayed by the browser, but you can of course put other elements within this section to markup the text or insert images.

<< Previous page | Next page >>