CSS - background-color


background-color sets a solid color for the entire background, including the padding and border background, of an element.

Possible Values:

  • color: Any color value in any valid format.
  • transparent

Applies to:

All the HTML elements.

DOM Syntax:

object.style.backgroundColor="Any value as defined above";


<p style="background-color:yellow;">  This text has a yellow background color.  </p>  

This will produce following result:

This text has a yellow background color.

Spacer Bottom Left Corner ImageBottom Right Corner Image
Valid XHTML 1.0 Strict  Valid CSS! Check the accessibility of this site according to U.S. Section 508