You are on page 1of 5

CSS

olors

Ravishankar kushwah
CSS Colors by Name
In this CSS color property, we will use the
color name to set color on the text.
In this we can use predefined color names
With CSS, colors can be set by using color names:

byName.html

<p>CSS Color</p>

byName.css

p {color: yellow;}

Output: CSS Color

Ravishankar kushwah
CSS Colors by RGB
RGB color values are supported in all browsers.
An RGB color value is specified with: rgb( RED , GREEN , BLUE ).
Each parameter defines the intensity of the color as an integer between
0 and 255.
We can set rgb value by using this: rgb(red,green, blue)

byRGB.html

<p>CSS Color</p>

byRGB.css

p {color: rgb(0,255,0);}

Output: CSS Color

Ravishankar kushwah
CSS Colors by HEX
Hexadecimal color values are also supported in all browsers.
A hexadecimal color is specified with: #RRGGBB.
RR (red), GG (green) and BB (blue) are hexadecimal integers between 00

and FF specifying the intensity of the color.

byHEX.html

<p>CSS Color</p>

byHEX.css

p {color: #0000FF;}

Output: CSS Color

Ravishankar kushwah
Do you find it helpful?
Let me know down in the comments !

Ravishankar kushwah
@coderavii
coderavi

You might also like