css - background-color
Property Name
background-color
Version
CSS 1Description
The background-color property of cascading style sheet sets the background color of an element of the document.Default value
transparentSupporting browsers
FirefoxChrome
Safari
Opera
Internet Explorer
Property values and Description
Value | Description |
---|---|
color | This property specifies the background color of the element. |
transparent | This value is default. This property specifies the background color should be visible as transparent. |
Inherit | This property specifies that background color of the document should be inherited from its parent object or element. |
Code view
background-color:#999999;
Demo
The background-color property added to the background of the Sample Text.Other Variations
background-color:green;
/* you may enter its value through the color names also */
background-color:rgb(255,105,164);
/* you may enter its value as the rgb value also [rgb = red, green and blue] */
/* you may enter its value through the color names also */
background-color:rgb(255,105,164);
/* you may enter its value as the rgb value also [rgb = red, green and blue] */
Some more examples
background-color:red;
background-color:green;
background-color:blue;
background-color:#09C;
background-color:#F66;
background-color:#939;
background-color:rgb(155,122,255);
background-color:rgb(125,0,201);
background-color:rgb(21,36,199); background-color:hsl(121,75%,41%);
background-color:green;
background-color:blue;
background-color:#09C;
background-color:#F66;
background-color:#939;
background-color:rgb(155,122,255);
background-color:rgb(125,0,201);
background-color:rgb(21,36,199); background-color:hsl(121,75%,41%);
0 comments: