Tutorials Point


  CSS Home

  CSS Reference
  Pseudo Classes & Elements

Copyright © 2014 by tutorialspoint



  Home     References     Discussion Forums     About TP  

CSS - background-color


previous next AddThis Social Bookmark Button


Advertisements

Description:

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";

Example:

<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.

To Become more comfortable - Do Online Practice



previous next Printer Friendly

Advertisements


  

Advertisements