The color code can be one of:
Hexadecimal format: #rrggbb
RGB format: rgb (red, green, blue)
For orange:
Hexadecimal: #FFA500
RGB Format: RGB(255,165,0)
Name format: orange
For a specific element:
<element style="color: code;"/</element/
For all elements of the same type. Place the code in the <style/ tag in the header section:
<style/
element {color: code; }
</style/
Green colors
- turf #7CFC00 RGB (124,252,0)
- chartreuse #7FFF00 RGB (127.255.0)
- light green # 32CD32 RGB (50,205,50)
- Lime #00FF00 RGB (0.255.0)
- forest green #228B22 RGB (34,139,34)
- green #008000 RGB (0,128,0)
- dark green #006400 rgb(0,100,0)
- yellow-green #ADFF2F RGB (173,255,47)
- yellow green #9ACD32 RGB (154,205,50)
- spring green #00FF7F RGB (0,255,127)
- medium spring #00FA9A RGB (0,250,154)
- light green #90EE90 RGB (144 238 144)
- pale green #98FB98 RGB (152 251 152)
- dark green #8FBC8F RGB (143 188 143)
- medium # 3CB371 RGB (60 179 113)
- celadon #2E8B57 RGB (46,139,87)
- olive #808000 RGB (128,128,0)
- dark olive #556B2F RGB (85,107,47)
- olive #6B8E23 RGB (107,142,35)
orange colors
- coral #FF7F50 RGB (255,127,80)
- tomato #FF6347 RGB (255,99,71)
- Orange Red #FF4500 RGB (255.69.0)
- gold #FFD700 RGB (255 215.0)
- orange #FFA500 RGB (255,165,0)
- dark orange #FF8C00 RGB (255,140,0)
blue colors
- light blue #E0FFFF RGB (224,255,255)
- cyan #00FFFF RGB (0,255,255)
- aqua #00FFFF RGB(0,255,255)
- Aquamarine #7FFFD4 rgb (127,255,212)
- medium aquamarine #66CDAA RGB (102 205 170)
- turquoise palette #AFEEEE RGB (175 238 238)
- turquoise #40E0D0 RGB (64 224 208)
- medium turquoise #48D1CC RGB (72 209 204)
- dark turquoise #00CED1 RGB (0,206,209)
- light #20B2AA RGB (32 178 170)
- Cadet Blue # 5F9EA0 RGB (95 158 160)
- dark blue #008B8B RGB (0,139,139)
- turquoise #008080 RGB (0,128,128)
Link color
The link color changes in a similar way, only you need to specify <a> as a selector:
a {color: red; }
If you want to change the color on hover, then add the :hover pseudo-class:
a: hover { color: #A52A2A; }
HTML colors
RGB and RGBA
The RGB system uses three numbers that describe the relative amount of red, green, and blue that are mixed together to produce any given hue. The numbers can range from 0 to 255. Consider the RGB code for a dark purple color: rgb(204, 51, 255), which can be applied to a CSS font color property, for example:
color: rgb(205, 51, 255);
The RGBA system adds another number that describes the transparency of the color, the value can range from 0 (fully transparent) to 1 (fully opaque). A value of 0.5 makes the color translucent, consider the translucent version of the dark purple color given by the RGBA system:
color: rgba(204, 51, 255, 0.5);
You can see that the red, green and blue color values ​​are similar to the RGB system. The fourth number - 0.5 is the degree of transparency. The "A" in RGBA stands for alpha channel, which is a graphic design term for transparency.
RGBA colors are useful for creating semi-transparent elements that allow the elements below them to be visible.
By name
Internet Explorer Chrome Opera Safari Firefox Android iOS
4.0+ 1.0+ 3.5+ 1.3+ 1.0+ 1.0+ 1.0+
Browsers support some colors by name. In table. 1 shows the names, hex code, values ​​in RGB, HSL format and description.
Tab. 1. Color names
Name Color Code RGB HSL Description
white #ffffff or #fff rgb(255,255,255) hsl(0.0%,100%) White
silver #c0c0c0 rgb(192,192,192) hsl(0.0%,75%) Gray
gray #808080 rgb(128,128,128) hsl(0.0%,50%)
black #000000 or #000 rgb(0,0,0) hsl(0.0%,0%) Black
maroon #800000 rgb(128,0,0) hsl(0,100%,25%) Dark red
red #ff0000 or #f00 rgb(255,0,0) hsl(0,100%,50%) Red
orange #ffa500 rgb(255,165,0) hsl(38.8,100%,50%)
yellow #ffff00 or #ff0 rgb(255,255,0) hsl(60,100%,50%) Yellow
olive #808000 rgb(128,128,0) hsl(60,100%,25%)
lime #00ff00 or #0f0 rgb(0,255,0) hsl(120,100%,50%) Light green
green #008000 rgb(0,128,0) hsl(120,100%,25%)
aqua #00ffff or #0ff rgb(0,255,255) hsl(180,100%,50%) Cyan
blue #0000ff or #00f rgb(0,0,255) hsl(240,100%,50%) Blue
navy #000080 rgb(0,0,128) hsl(240,100%,25%) Dark blue
teal #008080 rgb(0,128,128) hsl(180,100%,25%)
fuchsia #ff00ff or #f0f rgb(255,0,255) hsl(300,100%,50%) Pink
purple #800080 rgb(128,0,128) hsl(300,100%,25%)
With RGB
You can define a color using the red, green, and blue values ​​in decimal terms. Each of the three color components takes a value from 0 to 255. It is also permissible to set the color as a percentage, while 100% will correspond to the number 255. First, the keyword rgb is indicated, and then the color components are indicated in brackets, separated by commas, for example rgb(255 , 128, 128) or rgb(100%, 50%, 50%).