Friday, July 21, 2017

CSS color codes

CSS color codes are often a puzzle for novice HTML / CSS developers. # FF0000 ... What does this mean?




CSS color codes are hexadecimal values ??of a certain color. If you worked in a Photoshop color picker, you should have seen these codes.

An alternative to hexadecimal color codes are RGB color codes. RGB stands for red green blue. Therefore, if you want to specify a specific color, you will set each color value separately, for example R: 255 G: 0 B: 0. Keep in mind that the minimum value is 0 and the maximum value is 255, so in this example we specified Red color.

The hexadecimal color values ??also function this way, so if you want to specify a color, you will combine the RGB values ??converted to hex numbers, for example:

Red: 255 = FF

Green: 0 = 00

Blue: 0 = 00

Result: # FF0000

For all these color codes to work for you, you must insert them into your CSS statement as follows:

Style = "color: # FF0000;"

An alternative way is to specify the RGB value:

Style = "color: RGB (255.0.0);"

And the easiest way to specify a color using CSS is:

Style = "color: red;"


The last example of setting the color by the color name has some limitations: there are only 16 colors that you can use: aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white And yellow.

And the last tip for hexadecimal CSS color codes is that you can cut. The hexadecimal code can be shortened if the pairs have the same values. For example, if you want to specify a red color, you must write # FF0000. To make it shorter, you can safely write # F00, since you shortened the code like this:

FF = F

0 comments:

Post a Comment