ADVERTISEMENT

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

Telegram Group Join Now

ADVERTISEMENT

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

Color in CSS
Color in CSS

 

ADVERTISEMENT

ADVERTISEMENT

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:

ADVERTISEMENT

  1. Color Name
  2. Hexadecimal Color Value
  3. RGB Color Value

Color Name

ADVERTISEMENT

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

Example:

.color-name {
color:red;
}

Hexadecimal Color Value

ADVERTISEMENT

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

ADVERTISEMENT

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) .

ADVERTISEMENT

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

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)

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

ADVERTISEMENT

50+ HTML, CSS & JavaScript Projects With Source Code

ADVERTISEMENT

Thanks For Reading!

ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT

Telegram Group Join Now

Share on:

Leave a Comment

ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT