CSS background-color property


CSS background-color property defines the background-color of an element.


background-color : color-name | rgb value | hexadecimal value

Property values


Any name of the color can be used as the value of background-color. The default color of background is blue for an element.

background-color: transparent;


The following demo represents skyblue color for the background of an element.

background-color: skyblue;

rgb value

It represents rgb value of a color. The hexadecimal value of red color is given below.

background-color: rgb(255,0,0);

hexadecimal value

It represents hexadecimal notation of red color. The hexadecimal notation of blue color is given below.

background-color: #0000ff;

Applicable to

It applies to all elements

#CSS digger
Was this article helpful?