![]()
Document Color and Background Images
Recent drafts to HTML, as well as Netscape enhancements, add attributes to the BODY tag that allow you to specify colors for the fore and background of your documents, as well as place an image into the document which behaves as a background image for it.Background Color
Use the BGCOLOR attribute to change the color of the background in a document; many graphical browsers support it. The attribute allows you to change the color of the background without specifying a separate image. The attribute is part of the BODY tag:<BODY BGCOLOR="#rrggbb"> . . Document text is here. . . </BODY>
"#rrggbb"is entered in hexadecimal red-green-blue (RGB) triplet, where 00 (zero-zero) is the lowest for each color value, and FF the highest. For example, the hex RGB for white is #FFFFFF. Black in hex RGB is #000000 (those are zeroes (0)), and the typical default grey is #C0C0C0.You can find an RGB Color Chart at: http://www.phoenix.net/~jacobson/rgb.html
Foreground Color
There are attributes which allow you to change the colors for the text in a document. This is extremely useful when also using the BGCOLOR attribute, to establish the proper contrast for readability. The following are attributes of the BODY tag.TEXT Attribute
<BODY TEXT="#RRGGBB">This attribute is used to control the color of all normal text in the document (text that is not specially colored to indicate a link). The format of TEXT is the same as that of BGCOLOR.LINK, VLINK, & ALINK Attributes
<BODY LINK="#RRGGBB" VLINK="#RRGGBB" ALINK="#RRGGBB">These attributes let you control the color of link text. VLINK is for a visited link, and ALINK is for an active link. Netscape defaults for these are: LINK=blue, VLINK=purple, and ALINK=red. The format for these attributes is the same as that for BGCOLOR and TEXT.Example:
<HTML> <HEAD> <TITLE>Color Control Example</TITLE> </HEAD> <BODY BGCOLOR="#000000" TEXT="#F0F0F0" LINK="#FFFF00" VLINK="#22AA22" ALINK="#0077FF"> This is an example document. Text is light-gray on black, and <a href="bg.html#example">anchors</a> (this one leads back to the previous page) are yellow at first, flashing blue-green when activated, and pale green if already visited. </BODY> </HTML>(Go to the Example)BACKGROUND Attribute
<BODY BACKGROUND="graphics/bground.gif">The purpose of the BACKGROUND attribute is to specify a URL pointing to an image that's to be used as a background for the document, tiling the full background of the document-viewing area. The background image used for the Introduction to HTML pages is bgX.gif. It's the black zipper border you see on the left which then stretches out as a white background for the text.For background images check out:
http://www.alchemy.com.au/miles.of.tiles/
You can also visit Netscape's background sampler at:
http://home.netscape.com/assist/net_sites/bg/backgrounds.html
Back to Images Index Back to the Ziplink 101 page ©2000 ZipLink. All Rights Reserved.