Draft - Be careful with colours

This is a draft "webmaster tip", under work and review by the Quality Assurance Team, and shouldn't be considered as an official tip from W3C while it remains a draft.

  1. Most browsers use dark foreground colours, typically black for text, underlined blue for links, and a slightly different underlined blue for visited links.
  2. That's also the case for old browsers not supporting CSS. Therefore changing the background colour is tricky:
  3. Dark background colours are out - unless the foreground colour is also changed. Ideally checked with a service converting all colours to a monochrome scheme, if it still works it might be fine also for the colourblind.
  4. Mixing legacy markup and CSS can have hilarious effects like a legacy black/blue foreground on a dark background, if editors use bgcolor="black" for the BG, and style="color: white" for the FG.
  5. Using a legacy <font color="white"> is deprecated. Violating that rule is an option, otherwise better don't use legacy markup for dark backgrounds.
  6. Outside of CSS stay away from the hex. #rgb notation, old browsers only know #rrggbb (six hex. digits). Maybe use one of the sixteen colour names, that's guaranteed to work on the most limited devices, cell-phones, PDAs, printers, etc. (as far as they support colours).
  7. Text browsers don't support colours. (They need them internally to display physical and logical style tags like <code> on text mode displays with a single monospaced font).
  8. XHTML Basic and Print don't support inline CSS. If available use class= references to an external style sheet.

Further Reading


Valid XHTML 1.0!
Created Date: 2006-04-23 by Frank Ellermann
Last modified $Date: 2004/03/25 11:43:11 $ by $Author: dom $

Copyright © 2000-2003 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark, document use and software licensing rules apply. Your interactions with this site are in accordance with our public and Member privacy statements.