CSS Colors

Colors are the quintessential part of styling in general. Web page designers also need to be very specific about their color choices to provide the right feel to the user. Thus, web-page styling language CSS, also has colors as one of its important features.

Almost all the popular browsers in their latest versions, allow 120+ colors. CSS has different ways of controlling the coloring aspect of the web-pages. Let’s take a look at each, one by one.

Color Names

The easiest way is to specify the color name you wish to use and CSS has the color names already associated with the respective colors at your service. Currently, CSS can recognize up to 140 different color names.

RGB Values

The RGB color scheme is one of the most used styling techniques in programming. Each color is defined by the different intensities of the base colors (Red, Green, Blue) the minimum allowed value for each of the three colors is 0 and the maximum is 255. So, if the color code is (0,255,0) we know that the color is Green.

Hexadecimal Values

It is somewhat similar to RGB but here, instead of three different numbers, we use a single Hexadecimal code for each color. The general hexadecimal code for any color is #RRGGBB. Therefore the RGB intensity is defined in a single code with values ranging from 00 to FF for each RR, GG, and BB. The hexadecimal codes can be used in both Upper and Lower cases.

The CSS Colors can be used for simple HTML elements like texts, backgrounds, table cells, etc. As mentioned earlier, CSS can recognize 140 color names which covers all the requirements. However, the Hexadecimal and RGB codes enabled CSS to use more than 16.5 million color shades which helped it to create more complex styling constructs like animations, shadows, etc.

Read More

CSS Fonts: family list style size weight variant examples

What is CSS Definition, Advantages, and Uses