W3CWeb Accessibility Initiative Home

font colors and backgrounds

This is an outdated draft.

Current information is linked from the WAI website: w3.org/WAI

Some 2020 information on text and background contrast is in Understanding Success Criterion 1.4.3: Contrast

On this page: Test 1 | References | About these tests

Nearby: More HTML 4.01 Tests | UAAG 1.0 Test Suite

UAAG 1.0 Requirement

Checkpoint 4.3 Configure text colors (Priority 1 )
Provision 1 : Allow global configuration of the foreground and background color of all visually rendered text content.
Provision 2 : As part of satisfying provision one of this checkpoint, provide a configuration option to override foreground and background colors specified by the author or user agent defaults.

Test 1 :


  1. Configure the user agent to render the following test text using user specified colors and background colors.

Run test

Text color: black, background-color: white

Text color: white, background-color: black

Text color: red, background-color: white

Text color: blue, background-color: white

Text color: green, background-color: yellow

Text color: white, background-color: red

Expected results

  1. The user agent allows the user to chose font color and background color to be used to render text.
  2. The user agent makes available to the user a range of font and background colors.

Source code

<div style="font-size: large; font-family: sans-serif">
  <p style="color: #000000; background-color: #ffffff">Text color: black, background-color: white</p>
  <p style="color: #ffffff; background-color: #000000">Text color: white, background-color: black</p>
  <p style="color: #ff0000; background-color: #ffffff">Text color: red, background-color: white</p>
  <p style="color: blue; background-color: #ffffff">Text color: blue, background-color: white</p>
  <p style="color: green; background-color: #ffff42">Text color: green, background-color: yellow</p>
  <p style="color: #ffffff; background-color: #ff0000">Text color: white, background-color: red</p>


  1. HTML 4.01 specification for STYLE
  2. CSS2 specification for colors and backgrounds

About this test suite

This test is part of a test suite for the User Agent Accessibility Guidelines (UAAG) 1.0 . This work is conducted by the User Agent Accessibility Guidelines Working Group , which is part of W3C's Web Accessibility Initiative (WAI) . Please send comments on this test to w3c-wai-ua@w3.org ( public archive ).

Test created by:

Last modified: $Date: 2020/11/04 18:27:50 $ by $Author: shawn $