CSS Property - Background Color

Value: <color> | transparent
Initial: transparent
Applies to: all elements
Inherited: no
Percentage values: N/A

This property sets the background color of an element. When validating your CSS documents with the W3C Validator setting the "background-color" without a "color" will produce a "warning".

The use of "transparent" as a "background-color" will also trigger a "warning" with the CSS Validation Service. You need to ensure that when setting colours that the base colours are set in the body, so providing a correct cascade of colouring for accessibility issues.

Example:

body{
background-color: #FFFFFF;
}

To Validate without warnings:
body{
background: #FFFFFF;
color:#000000;
}

Check Out Our Sponsors
Check Out Our Host

ANHosting

Free CSS.com is proud to be hosted by ANHosting.com. US Based Support starting at only 23 cents a day.
Use the coupon code FREECSS for 3 free months of hosting. Click Here »

Bookmarks
RSS Feed    Search

Support Free CSS.com. Sign up for a FREE account with MailChimp. No Credit Card Necessary!