Table of ContentsContents
|
The Body TagThe minimal body tag is <body> and that provides the default colors of black text on a white background with links being blue and visited links turning purple. No active link color is defined. In order to change these colors to something other than the default color you need to use RGB Colors in Hexidecimal.An example of a body tag with white text on a black background with red links, pink visited links and light green active links would be... <body text="#FFFFFF" bgcolor="#000000" link="#FF0000" vlink="#FFAAAA" alink="#AAFFAA"> The active link color only appears while the mouse button is depressed over the hypertext. For that instant the link color turns light green in the example above. You can use an image as a background and that is specified in the body tag as well. The image will be tiled automatically until if fills the whole screen. The idea is to keep the background image's file size small so it doesn't take forever to download. The code to load an image as a background can be used in addition to the code to specify a background color. This often a good idea since the background color will come in almost immediately and provide contrast against the text color so the text will show up well until the background image downloads. In the example above, let's say we created an image (bg.jpg) that consists of mostly dark colors to contrast the white text. Until that image downloads the white text would be offset nicely by the black background color. The example above with the code to load a background image named bg.jpg would be... <body text="#FFFFFF" bgcolor="#000000" background="bg.jpg" link="#FF0000" vlink="#FFAAAA" alink="#AAFFAA"> The body tag is closed at the end of the webpage code. It is usually the second to last line...</body> |