CSS color

CSS color is used to set the color of an HTML elements content in web pages. HTML content color can be in hex format, rbga format and color names etc.

The syntax for CSS color is:

For Example:


This is the HTML paragraph. We have given color to it. The color is green.

CSS color values list

The values and description of this property is used to specify the color of content inside web document. You should also see CSS background-color.

Sr. No.valueDescription
1hex color codesUsed to give color code in hex value format for the content. The value for this can be #fff, #000 etc.
2rbga color codesUsed to give color code of content in rbga() format. The value for this can be rgba(255, 0, 0, 0.48), rgba(111, 66, 66, 0.48) etc.
3color nameUsed to give color name to apply color to web content. The value for this can be red, blue etc.
4transparentUsed to make a transparent color of an HTML element content. The value for this is transparent.
5initialUsed to define as the property initial value.
6inheritUsed to define the computed value of property on the elements parent.
7unsetUsed to set all the properties to their parent value if inheritable.

CSS color rgba()

In this example we use color with color value as rgba format.


This is my paragraph inside the span tag. The class for span is mycolor.