Plan your text ad campaign.
WestNIC provides reliable web hosting services
Free software downloads and drivers download resources
This answer is part of the Code Style premium content package. You must have a premium content subscription to log in and view the full answer to this question. Use the premium content subscription form below.
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.
More details available to premium content service subscribers:
How do I set the background colour in CSS?
You must make a subscription payment to access areas flagged premium content. Use the form below to create an account via PayPal.
The PayPal service allows you to pay securely and independently in your own currency. Payments are billed to Metacentric Internet Limited. We never handle your credit card details.
The Code Style site has accumulated 8 years' worth of answers to the most common Web development questions. Answers are written in clear English with examples and links to other Web resources. Your subscription provides full answers to all premium content questions listed below and other FAQ sections, plus: