CSS font stacks & developer FAQs with Web standards
Site navigation below

One of hundreds of answers available with our premium content service.

Part answer, see below for more

A: When you set the background colour of a Web page using CSS you should also set the text colour, to ensure that there is a legible contrast between them. This is because some people configure their browsers to display Web pages with their own style sheet, which may have its own text colour setting. If you set the background colour without the text colour, your background may be the same as the reader's foreground text colour.

The background colour for the whole page is attached to the HTML body element, as below, but you can use any CSS selector to colour more specific areas of the page.

… full answer hidden

Click for full answers

Premium members click below for full answer
How do I set the background colour in CSS?

Premium service benefits

Your premium content subscription is a single payment that gives you:

Home · Web fonts · Font stacks · FAQs · Java · CSS · Javascript · HTML · Site manager