
The value can be an integer between 0 and 255 or a percentage. This property takes three values, one each for red, green, and blue. This color value is specified using the rgb( ) property. In this format, each digit is replicated to arrive at an equivalent six-digit value. This is a shorter form of the six-digit notation.

Following are the examples to use Hexadecimal notation. The first two digits(RR) represent a red value, the next two are a green value(GG), and the last are the blue value(BB).Ī hexadecimal value can be taken from any graphics software like Adobe Photoshop, Jasc Paintshop Pro, or even using Advanced Paint Brush.Įach hexadecimal code will be preceded by a pound or hash sign '#'.

These formats are explained in more detail in the following sections − CSS Colors - Hex CodesĪ hexadecimal is a 6 digit representation of a color. Following table lists all the possible formats − Format You can specify your color values in various formats. They can also be used to affect the color of borders and other decorative effects.

Typically, these are used to set a color either for the foreground of an element (i.e., its text) or else for the background of the element. CSS uses color values to specify a color.
