This is a legacy document, and retained on the site in order to avoid link rot. The content is likely no longer (a) accurate, (b) representative of the views and philosophies of current site management, or (c) up to date.

CSS Color Issues

Color Considerations

Due to discussions in the newgroup, CIWAH , these comments are intended to reconcile the ability of a CSS author to set colors and the ability of a user to set overriding colors. Given the usual CSS Caveats, it seemed reasonable to re-visit the issues raised by Warren Steele in his essay, What's Wrong with FONT , in the areas of author-designated color.

The advice to set all colors if you set one color is still viable. (1) If you set 'background-color' in your CSS file, be sure that you also set color. If you have the 'background-color' set to 'Black', and do not set your text color to contrast, a viewer of your document with text 'color' set to 'black' will see…nothing. Even in a less extreme situation, user specified colors may not interact well with the colors you have chosen. If, for example, the user has specified 'darkolivegreen' for text in their stylesheet, and failed to specify a light 'background-color', your document with the black background will be barely legible. This instance, however, cannot be your fault. The user should exhibit the same good sense the author has in setting 'all or none' in colors.

A lengthy discussion of 'highlighting' (2) produced a variety of responses, with a variety of rationales, as well. As is often the case when reasonable people disagree, there was no single 'correct answer by consensus'.

A suite of tests was devised to test overriding by

Varying colors were set/un-set so that differences would readily appear.

Select

(1) Side note: In looking at a provided URL in a ciwa-stylesheets post, I discovered that the author had set 'background-color' to black and color to white in his CSS file, then had set background to white and text to black in one of his HTML files. Because of specificity, the resulting rendering was certainly not what the author intended. Because he had set color on <Hn> and <LI> in his CSS file, those elements appeared in the rendering, but the majority of his document was invisible.

(2) See the highlighting tests.

-

Sue Sims