Color in CSS

Use Color in CSS BY Color Name, Hexadecimal Color & RGB Color Value

Use Color in CSS BY Color Name, Hexadecimal Color & RGB Color Value

Color in CSS
Color in CSS

 

In this article, we learn how to use Css Color on the html tags. we can use Css color in 3 ways.

CSS colors are commonly specified using the following:

  1. Color Name
  2. Hexadecimal Color Value
  3. 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.

Restaurant Website Using HTML And CSS With Source Code

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 Code with Color Name, Hex and RGB Color Values

ColorColor NameHex Color ValueRGB Color Value
White#ffffffrgb(255, 255, 255)
Silver#C0C0C0rgb(192, 192, 192)
Gray#808080rgb(128, 128, 128)
Black#000000rgb(0, 0, 0)
Red#ff0000rgb(255, 0, 0)
Maroon#800000rgb(128, 0, 0)
Yellow#ffff00rgb(255, 255, 0)
Olive#808000rgb(128, 128, 0)
Lime#00ff00rgb(0, 255, 0)
Green#008000rgb(0, 128, 0)
Aqua#00ffffrgb(0, 255, 255)
Teal#008080rgb(0, 128, 128)
Blue#0000ffrgb(0, 0, 255)
Navy#000080rgb(0, 0, 128)
Fuchsia#ff00ffrgb(255, 0, 255)
Purple#800080rgb(128, 0, 128)

that’s it for today hope you like this article and you can visit more articles and create HTML, Css, and javascript projects.

50+ HTML, CSS & JavaScript Projects With Source Code

Thanks For Reading!



Leave a Reply