HTML Tutorial


Lesson 5
Other Body Tag Functions

You may use the <body> tag to:

  • Include a background graphic by using background="file".
    Keep your background file small and do not choose a pattern that makes reading the text difficult. Also realize that people will view your background at different resolutions. In order for a background not to repeat horizontally on higher resolutions it should be at least 1,200 pixels wide. A left margin that repeats and obscures text will definitely detract from your site.

  • Set the background color by including bgcolor=#rrggbb.
    If you use a background graphic, your background color should approximate the color of the graphic to make your text readable in case the background graphic does not load.

  • Set the color of your text with text=#rrggbb.

  • Set the color of your links with link=#rrggbb.

  • Set the color of your visited links with vlink=#rrggbb.

    Your text, link and visited link colors should be easy to read against your background.

An example of a <body> tag with all of the above:
<body background="./gfx/back.gif" bgcolor=#dcc4ac text=#6c2c14 link=#006600 vlink=#a00000>

LESSON 4 | HOME PAGE | LESSON 6

© Geo. McCalip 2001