★ wanayoo — archive 1999 http://webdeveloper.com/drweb/96May20-drwebsite.htmlNouvelle recherche | Portail wanayoo

DR. WEBSITE

Make Sure Your Site Shows Its True Colors

By Eileen Mullin

Dear Dr. Website®: I want to reset the color of a hyperlink back to blue once it has been visited. Is there a way to control the color of hyperlinks on a Web page?

Yes--as long as visitors to your site are using browsers that support Netscape extensions.

Normally, your pages' hyperlinks appear in blue, with visited links displaying in purple type. When you click on a link to activate it, it should turn red for an instant.

However, there are Netscape extensions that let the server side specify different colors for these three different kinds of links. These attributes should appear in the <BODY> tag, and are called LINK, VLINK (for visited link) and ALINK (for active link).

You can specify the color values you want using the hexadecimal color system, which unfortunately is not at all intuitive. Luckily, there are many Web sites that offer color samples with their accompanying hexadecimal values; one such example is InfiNet's background colors list.

There also are sites that offer on-the-fly conversion or online calculations for converting to hex from RGB (red-green-blue), a color model that's much more familiar to computer users. DesignSphere Online is one such resource that provides online RGB-to-hex and hex-to-RGB conversions.

To return to your original question, you can make the color of a visited link the same as that of an unvisited one by setting LINK and VLINK to the same color values. For example, to make visited and unvisited links appear in blue type, your <BODY> tag should include the following code:

<BODY LINK="#0000FF" VLINK="#0000FF">

The Microsoft Internet Explorer 2.0 and Netscape Navigator 2.0 browsers each can recognize a short list of colors by given names for attributes (e.g., ). This has shortcomings, however, for users whose browsers don't recognize these color names or if a color's name is misspelled in the source code.

Dear Dr. Website®: How can you make sure the colors in a graphic look the same to both Mac users and Windows users? Is there such a thing as a cross-platform color palette for saving Web graphics?

Web graphics optimized by Mac designers for their own viewing may appear too dark when viewed on Windows machines because of cross-platform differences in gamma, which controls color contrast. In addition, the Macintosh and Windows system palettes are not entirely synchronized, and 24-bit JPEGs can take on odd color combinations when viewed on monitors capable of only 256 or 16 colors.

When the colors defined in a graphic aren't available on a user's monitor, they will dither, which means that the available colors will intersperse to give an approximation of the missing color value. Dithering can have the overall effect of reducing image quality.

If you want to ensure as best you can that your Web graphics won't dither, your images should adhere to Netscape's color palette for Windows, which uses only 216 colors. These colors will not dither under Microsoft Internet Explorer, either. There are a number of online resources that explore Netscape's scheme for colors that won't dither, including The 256, Oops, 216 Colors of Netscape.

If the majority of your user audience is Unix-based, take a look at Sun Microsystems' Guide to Web Style, which includes coverage of the 125-color table used by some flavors of Unix.


Send your site development questions to Dr. Website at drweb@internet.com, or visit the Ask Dr. Website page.

Reprinted from Web Week, Volume 2, Issue 6, May 20, 1996 © internet.com Corporation All rights reserved. Keywords: design links graphics Date: 19960520

http://www.internet.com