CSS Colors | css colors codes – codewithrandom

CSS Colors | css colors codes – codewithrandom

CSS colors are commonly specified using the following:

  • Color Name
  • Hexadecimal Color Value
  • RGB Color Value

Color Name

It defines any valid color by its color name e.g.Red , Green , Blue, etc.

Example:

 .color-name {  
color:red;
}

Hexadecimal Color Value

Also known as Hex Color Value. It defines any valid color by a hash followed by letters and/or numbers e.g. #00FF00,etc.

Example:

 .hex-code {  
color: #00ff00;
}

RGB Color Value

RGB stands for Red, Green and Blue. It defines any valid color using the rgb() . CSS function by this format: rgb( value1 , value2 , value3 )e.g. rgb(124,252,0) .

Note: The <value> should only be from 0 to 255.

The Values represent the intensity of the red, green and blue colors in that particular order.

Example:

 #rgb-color {  
color: rgb(0, 0, 255);
}

Most Common CSS Colors with Color Name, Hex and RGB Color Values

Color Color Name Hex Color Value RGB Color Value
White #ffffff rgb(255, 255, 255)
Silver #C0C0C0 rgb(192, 192, 192)
Gray #808080 rgb(128, 128, 128)
Black #000000 rgb(0, 0, 0)
Red #ff0000 rgb(255, 0, 0)
Maroon #800000 rgb(128, 0, 0)
Yellow #ffff00 rgb(255, 255, 0)
Olive #808000 rgb(128, 128, 0)
Lime #00ff00 rgb(0, 255, 0)
Green #008000 rgb(0, 128, 0)
Aqua #00ffff rgb(0, 255, 255)
Teal #008080 rgb(0, 128, 128)
Blue #0000ff rgb(0, 0, 255)
Navy #000080 rgb(0, 0, 128)
Fuchsia #ff00ff rgb(255, 0, 255)
Purple #800080 rgb(128, 0, 128)
Share on:

Leave a Comment